Like most of the demanding childs.Pratik don't stop until he gets that.He keep on repeating the name of that thing again and again.
For example if he want a computer,He will keep on repeating "computer" again and again.
His dad has decided to answer to his demand as "Yes" or "No" without any delay.Otherwise there would be a lot of repercussions.So, randomly at certain interval,He just answer with "Yes" or "No" by using following rule that he will select
two integers a and b, if the element at the position a is same as element at position b in the repeating chant pratik then he will speak "Yes", Otherwise he will say "No".
Your work is to find the answer of his dad given the name of the demand that pratik is asking for and the random integer his dad has picked.


Input


First line of the input contains a string S, the name of the item he is demanding.
Next line contains an integer T, the number of pairs of integer to answer "Yes" or "No".
For each next N lines, each line contains two space separated integers ai and bi.
Next T lines each contain 2 integers, a and b.



Output

For each query, print "Yes" or "No" as described above

Constraints


1 ≤ |S| ≤ 10^5
1 ≤ Q ≤ 10^5
1 ≤ a,b ≤ 10^18

 

Example
Input:
computer
4
3 7
2 10
5 21
11 26



Output:

No
Yes
Yes
No


Explanation

In the first case the character at 3rd position is 'm' and the character at 7th position is 'e' so the answer is "No"
In the second case the character at the 2nd position is 'o' and if we repeat the string (like computercomputercomputer...)
the character at 10th position is 'o' so the answer is "Yes"
s=raw_input()
t=int(input())
while t>0:
	a,b=map(int,raw_input().split())
	if s[(a-1)%len(s)]==s[(b-1)%len(s)]:
		print "Yes"
	else:
		print "No"
	t-=1