Given n numbers, determine whether n-1 numbers can be converted to 0 using following operation any number of times :
A subset of non-zero numbers (possibly empty) are chosen. Numbers in the chosen subset are decremented by 1, and the numbers not in the subset are incremented by K.
The first line contains the number of test cases T. 2*T lines follow, 2 for each case.
The first line of a test case contains the numbers n and K.
The next line contains n numbers, a_1...a_n.
Output T lines, one corresponding to each test case.
For a test case, output "YES" if there is a sequence of operations as described, and "NO" otherwise.
1 2 2
1 2 3
Number of Test Cases T,
1 < T <= 1000
2 < n <= 100
1 < k <= 10
0 < a_i <= 1200
Problem Setter : Vivek Bhatnagar