#P1438B. Valerii Against Everyone

    ID: 2815 Type: RemoteJudge 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: 3 Uploaded By: Tags>constructive algorithmsdata structuresgreedysortings*1000

Valerii Against Everyone

Description

You're given an array bb of length nn. Let's define another array aa, also of length nn, for which ai=2bia_i = 2^{b_i} (1in1 \leq i \leq n).

Valerii says that every two non-intersecting subarrays of aa have different sums of elements. You want to determine if he is wrong. More formally, you need to determine if there exist four integers l1,r1,l2,r2l_1,r_1,l_2,r_2 that satisfy the following conditions:

  • 1l1r1<l2r2n1 \leq l_1 \leq r_1 \lt l_2 \leq r_2 \leq n;
  • al1+al1+1++ar11+ar1=al2+al2+1++ar21+ar2a_{l_1}+a_{l_1+1}+\ldots+a_{r_1-1}+a_{r_1} = a_{l_2}+a_{l_2+1}+\ldots+a_{r_2-1}+a_{r_2}.

If such four integers exist, you will prove Valerii wrong. Do they exist?

An array cc is a subarray of an array dd if cc can be obtained from dd by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end.

Each test contains multiple test cases. The first line contains the number of test cases tt (1t1001 \le t \le 100). Description of the test cases follows.

The first line of every test case contains a single integer nn (2n10002 \le n \le 1000).

The second line of every test case contains nn integers b1,b2,,bnb_1,b_2,\ldots,b_n (0bi1090 \le b_i \le 10^9).

For every test case, if there exist two non-intersecting subarrays in aa that have the same sum, output YES on a separate line. Otherwise, output NO on a separate line.

Also, note that each letter can be in any case.

Input

Each test contains multiple test cases. The first line contains the number of test cases tt (1t1001 \le t \le 100). Description of the test cases follows.

The first line of every test case contains a single integer nn (2n10002 \le n \le 1000).

The second line of every test case contains nn integers b1,b2,,bnb_1,b_2,\ldots,b_n (0bi1090 \le b_i \le 10^9).

Output

For every test case, if there exist two non-intersecting subarrays in aa that have the same sum, output YES on a separate line. Otherwise, output NO on a separate line.

Also, note that each letter can be in any case.

Sample Input 1

2
6
4 3 0 1 2 0
2
2 5

Sample Output 1

YES
NO

Note

In the first case, a=[16,8,1,2,4,1]a = [16,8,1,2,4,1]. Choosing l1=1l_1 = 1, r1=1r_1 = 1, l2=2l_2 = 2 and r2=6r_2 = 6 works because 16=(8+1+2+4+1)16 = (8+1+2+4+1).

In the second case, you can verify that there is no way to select to such subarrays.