Problem2239--1656B-Subtract Operation

2239: 1656B-Subtract Operation

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

You are given a list of nn integers. You can perform the following operation: you choose an element xx from the list, erase xx from the list, and subtract the value of xx from all the remaining elements. Thus, in one operation, the length of the list is decreased by exactly 11.

Given an integer kk (k>0k>0), find if there is some sequence of n−1n−1 operations such that, after applying the operations, the only remaining element of the list is equal to kk.

Input

The input consists of multiple test cases. The first line contains a single integer tt (1≤t≤1041≤t≤104) — the number of test cases. Description of the test cases follows.

The first line of each test case contains two integers nn and kk (2≤n≤2⋅1052≤n≤2⋅1051≤k≤1091≤k≤109), the number of integers in the list, and the target value, respectively.

The second line of each test case contains the nn integers of the list a1,a2,…,ana1,a2,…,an (−109≤ai≤109−109≤ai≤109).

It is guaranteed that the sum of nn over all test cases is not greater that 2⋅1052⋅105.

Output

For each test case, print YES if you can achieve kk with a sequence of n−1n−1 operations. Otherwise, print NO.

Sample Input Copy

4
4 5
4 2 2 7
5 4
1 9 1 3 4
2 17
17 0
2 17
18 18

Sample Output Copy

YES
NO
YES
NO

Source/Category