Problem: You are given an array .
An anonymous informant has told you that the array was obtained as follows: initially, there existed an array , after which the following two-component operation was performed times:
- A fixed point of the array was chosen.
- Then, the array was cyclically shifted to the left exactly times.
As a result of such operations, the array was obtained. You want to check if the words of the anonymous informant can be true or if they are guaranteed to be false.
A number is called a fixed point of the array if and .
A cyclic left shift of the array is the array .
Input Format: Each test contains multiple test cases. The first line contains an integer () — the number of test cases. The description of the test cases follows.
The first line of each test case contains two integers (, ) — the length of the array and the number of operations performed.
The second line of each test case contains integers () — the elements of the array .
It is guaranteed that the sum of the values of for all test cases does not exceed .
Output Format: For each test case, output "Yes" if the words of the anonymous informant can be true, and "No" if they are guaranteed to be false.
Note: In the first test case, the array could be equal to . In the first operation, a fixed point was chosen, and after left shifts, the array became . In the second operation, a fixed point was chosen, and after left shifts, the array became . In the third operation, a fixed point was chosen again, and after left shifts, the array became , which is equal to the array .
In the second test case, the array could be equal to . After the operation with a fixed point , the array became . Then, after the operation with a fixed point , the array returned to its initial state . These same operations (with , and ) were repeated times. So, after operations, the array returned to .
In the third test case, it can be shown that there is no solution.