#Lutece1027. One step,two steps
One step,two steps
Migrated from Lutece 1027 One step,two steps
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
As we all know,the handsome boy, Zcat, has a fever of flat shoes
. He sings it on the class, in the dormitory and the way he come back from the machinery room to his dorm.One day , he sing it on the way, just like
"MY skating shoes are the most fashion one
At the way back to home I couldn't stop
rubbing rubbing
rubbing at such smooth floor
With the moonlight ,I was able to see my shadow was either very close or far
I felt that my step was forced by a kind of strength
With the skating shoes ,I will not afraid anything around the world
One step two steps,every one was just like zhuaya
The motion which was like a ghost was rubbing and rubbing
I beat to beat for myself
It's the best moment of my life
I'd got to finish my favorite dancing
At the terrfic street where moonlight fall
I told myself that it really wasn't dream
One step two steps ,every one was just like zhuaya
The gost step was rubbing and rubbing
rubbing at such smooth floor
The motion which was like a ghost was rubbing and rubbing
One step two steps,every one was just like zhuaya
One step two steps,every one was just like zhuaya
⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯“
On he sings this,he sees a pretty girl standing on by the roadside. Zcat wants to see the pretty girl's face. Zcat knows the distance between he and her is meters. Zcat also wants to see the girl's face clearly. So he must move forward exactly meters.To show the girl his favourite dancing,he has to follow the lyric One step two steps
of flat shoes
. When the lyric is one step
, he will move exactly meter. When the lyric is two steps
, he will move exactly meters. Now, Zcat knows the whole lyric. He wants to know is there a time he can start, then move forward following the lyric, and he will see the pretty girl clearly.
Input
The first line contains a single number denotes the length of the lyric of One step
and Two steps
.
The second line contains numbers.Anyone of these is or .
The third line contains a single number denotes the time of question.
The next line contains numbers denote then distance between Zcat and the pretty girl.
Output
To every question, if Zcat can see the girl clearly, print Yes
, else print No
.
Samples
8
2 1 1 1 1 2 2 2
6
1 3 5 7 9 11
Yes
Yes
Yes
Yes
Yes
No
Resources
MaxKU