Codeforces Round 698 (Div. 1) |
---|
Finished |
$$$n$$$ distinct integers $$$x_1,x_2,\ldots,x_n$$$ are written on the board. Nezzar can perform the following operation multiple times.
Now, Nezzar wonders if it is possible to have his favorite number $$$k$$$ on the board after applying above operation multiple times.
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^5$$$) — the number of test cases.
The first line of each test case contains two integers $$$n,k$$$ ($$$2 \le n \le 2 \cdot 10^5$$$, $$$-10^{18} \le k \le 10^{18}$$$).
The second line of each test case contains $$$n$$$ distinct integers $$$x_1,x_2,\ldots,x_n$$$ ($$$-10^{18} \le x_i \le 10^{18}$$$).
It is guaranteed that the sum of $$$n$$$ for all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, print "YES" on a single line if it is possible to have $$$k$$$ on the board. Otherwise, print "NO".
You can print each letter in any case (upper or lower).
6 2 1 1 2 3 0 2 3 7 2 -1 31415926 27182818 2 1000000000000000000 1 1000000000000000000 2 -1000000000000000000 -1000000000000000000 123 6 80 -5 -20 13 -14 -2 -11
YES YES NO YES YES NO
In the first test case, the number $$$1$$$ is already on the board.
In the second test case, Nezzar could perform the following operations to write down $$$k=0$$$ on the board:
In the third test case, it is impossible to have the number $$$k = -1$$$ on the board.
Name |
---|