Let's consider an array A of size N. You start from the index 0 and your goal is to reach the N−1 index in exactly M moves. At any index, you can move forward or backward by a number of steps equal to a prime divisor of the value which exists at that index. You can't go beyond the array while going forward or backward.
You have to output YES if it's possible to reach N−1 index in exactly M moves, otherwise you have to output NO.
You can see in the example above that the value at current index is 6, prime divisors of which are 2 and 3. You can go forward or backward by 2 or 3 steps, as long as you are within the boundaries. For example, you can't go forward by 3 steps.
Input Format:
First line contains T which is the number of test cases.
Each test case contains 3 lines.
First line of every test case contains an integer N where N is the size of the array.
Second line of every test case contains the N values [Xii,Xj,...] which represents the array.
Third line of each test case contains the number of moves M to reach the last index.
Output Format:
For each test case, output a line containing YES or NO depending on whether it is possible to reach in M moves.
Input Constraints:
1≤T≤10
2≤N≤40
1≤X≤106
1≤M≤106
Scoring according to difficulty of input constraints:
2≤N≤5, 1≤X≤10, 1≤M≤10: 30 pts
2≤N≤20, 1≤X≤103, 1≤M≤103: 30 pts
Original Constraints: 40 pts