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:
def LCA(arr,i,j):
	path1=[i]
	path2=[j]
	while(i/2>0):
		path1.append(int(i/2))
		i/=2
	while(j/2>0):
		path2.append(int(j/2))
		j/=2
	lca=1
	for i in range(0,max(len(path1),len(path2))+1):
		if path1[len(path1)-i-1]!=path2[len(path2)-i-1]:
			return [path1[0:len(path1)-i+1],path2[0:len(path2)-i+1]]
	
#~ print LCA([1,2,3,4,5,6,7,8,9,10,11],1,1)

def check(n,q,monsters,rooms):
	for i in range(len(rooms)):
		a = rooms[i][0]
		b = rooms[i][1]
		if(a!=b):
			path1,path2 = LCA(n,a,b)
			flag = 0
			for node in path1:
				if monsters[node-1]==1:
					flag+=1
					break
			for node in path2:
				if monsters[node-1]==1:
					flag+=1
					break
			if flag>0:
				print "No"
			else:
				print "Yes"
		else:
			if monsters[a-1]==1:
				print "No"
			else:
				print "Yes"

n,q = raw_input().split();
n = int(n)
q = int(q)

monsters = raw_input()
monsters = [int(x) for x in monsters]
nodes = []
for i in range(q):
	a,b = raw_input().split();
	a = int(a)
	b = int(b)
	nodes.append((a,b))
check(n,q,monsters,nodes)