Problem: Nandu is stuck in a maze consisting of N rooms. Each room with room number x has a door leading into room number 2x (if 2x ≤ N) and another door leading into room number 2x+1 (if 2x+1 ≤ N). All these doors are 2-way doors ie. they can be opened from both the sides.

Some of these N rooms have monsters living in them. 

Nandu is currently in room number i . Nandu's only escape from this maze is to somehow reach room number j which contains the magical Wish-Granting Well. The Well will only grant a wish to Nandu if he offers it a single golden coin. Nandu presently has only a single golden coin in his possession. However, if while going from room number i to j he meets a monster, the monster will take away the only golden coin Nandu has and Nandu will never be able to escape from the maze. 

You will be given information about every room telling you whether a monster resides in it or not. You will then be given Q scenarios, each scenario describing the locations i (the room currently Nandu is present in)  and j (the room where the wishing well is present), i and j will vary over different scenarios but the locations of the monsters will remain fixed for all these scenarios. For each of these scenarios, you have to find out whether Nandu can escape from the maze or not.

Input :

The first line consists on N and Q denoting the number of rooms in the maze and the number of different scenarios that will be given to you. The next line consists of N non-space separated integers such that if the kth integer is '0' , there is no monster present in room number k and if the kth integer is '1' , there is a monster present in room number k. The next Q lines are such that each line consists of two space separated integers i and j denoting Nandu's current location and the location of the Wishing Well for  this particular scenario respectively.

Output :

For every scenario print on a new line 'Yes' if Nandu can escape from the maze and 'No' if he cannot escape from the maze. (Quotes for clarity).

Constraints :

1 ≤ N ≤ 100000

1 ≤ Q ≤ 100000

1 ≤ i,j ≤ N

Author : Shreyans

Tester : Sayan

(By IIT Kgp HackerEarth Programming Club)

SAMPLE INPUT
3 9
001
1 2
1 3
3 2
2 1
2 3
3 1
1 1
2 2
3 3

SAMPLE OUTPUT
Yes
No
No
Yes
No
No
Yes
Yes
No

Explanation

A monster is present only in room number 3. 

Scenario 1 : Nandu is initially present in room number 1 and the Wish-Granting Well is present in room number 2 . Since there is no monster in either of the rooms Nandu goes from 1 -> 2 without losing his golden coin. Hence Nandu can escape the maze by making a wish to the Wish-Granting Well

Scenario 2 : Nandu goes from 1 -> 3. However, there is a monster present in room number 3, which takes away his only golden coin before he can make a wish to the Wish-Granting Well. Hence Nandu cannot escape the maze.

Solution (in PYTHON):

Solution:
n,q = map(int,raw_input().split())
b = raw_input()
import math
for i in range(0,q):
	x,y = map(int,raw_input().split())
	x,y = min(x,y),max(x,y)
	c,d = int(math.log(x,2)),int(math.log(y,2))
	e=[x,y]
	while d!=c:
		y=y/2
		e.append(y)
		d=int(math.log(y,2))
	while x!=y:
		y=y/2
		x=x/2
		e.append(x)
		e.append(y)
	test = True
	for i in e:
		if b[i-1]=="1":
			test = False
	if test:
		print "Yes"
	else:
		print "No"