You are given an array of size . You are asked to answer queries.
Each query is of the form :
You need to print Yes
if divides the value returned from function, otherwise print No
.
find(int i,int j)
{
if(i>j) return 1;
ans = pow(A[i],find(i+1,j))
return ans
}
Input Format
First line of the input contains . Next line contains space separated numbers. The line, thereafter, contains , the number of queries to follow. Each of the next lines contains three positive integer , and .
Output Format
For each query display Yes
or No
as explained above.
Constraints
value of array element
No 2 consecutive entries in the array will be zero.
Sample Input
4
2 3 4 5
2
1 2 4
1 3 7
Sample Output
Yes
No