P8550 Winter Flowers

Background

“Crying is not because of sadness, but simply because you are alive, tears will come out without you noticing.” After Hilde broke up, she went to the main road to race. Because she was racing, she did not want to stay on the road all the time, so she drove in circles on the yellow sand fields on both sides of the road. The steering of her cheap car had some problems, but she really wanted to drive in circles.

Description

Given $n$ numbers $a_1, a_2, \ldots, a_n$, and a non-zero number $x$. You need to perform ${10}^{100}$ operations. In each operation, you need to choose an index $i$ ($1 \le i \le n$), and then add $a_i$ to $x$. You must ensure that after each operation, the new value of $x$ is not $0$. Determine whether you can complete these ${10}^{100}$ operations.

Input Format

**This problem has multiple test cases.** The first line contains a positive integer $T$, the number of test cases. For each test case: - The first line contains two integers $n, x$. - The second line contains $n$ integers $a_1, a_2, \ldots, a_n$.

Output Format

For each test case, output one string per line. If you can perform ${10}^{100}$ operations, output `Yes`, otherwise output `No`.

Explanation/Hint

**[Sample Explanation]** For the first test case, in the first operation you can only choose index $1$, where $a_1=-1$, but $1+(-1)=0$, so you cannot perform the operation. Output `No`. For the second test case, you can alternate between choosing index $1$ and index $2$. Then $x$ will keep changing by $+1$ and $-1$, so it will always vary between $10$ and $9$. In this way, you can perform any number of operations. Output `Yes`. Of course, this is only one possible plan, and you may have other plans. --- **[Constraints]** - Test point 1 (50 points): $n = 1$. - Test point 2 (50 points): no special restrictions. For all test points: $1 \le T \le 30$, $1 \le n \le 5$, $1 \le \lvert x \rvert, \lvert a_i \rvert \le 100$. Translated by ChatGPT 5