You're given an array $b$ of length $n$. Let's define another array $a$, also of length $n$, for which $a_i = 2^{b_i}$ ($1 \leq i \leq n$). 

Valerii says that every two non-intersecting subarrays of $a$ have different sums of elements. You want to determine if he is wrong. More formally, you need to determine if there exist four integers $l_1,r_1,l_2,r_2$ that satisfy the following conditions:   $1 \leq l_1 \leq r_1 \lt l_2 \leq r_2 \leq n$;  $a_{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 $c$ is a subarray of an array $d$ if $c$ can be obtained from $d$ by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end.


-----Input-----

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

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

The second line of every test case contains $n$ integers $b_1,b_2,\ldots,b_n$ ($0 \le b_i \le 10^9$). 


-----Output-----

For every test case, if there exist two non-intersecting subarrays in $a$ 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. 


-----Example-----
Input
2
6
4 3 0 1 2 0
2
2 5

Output
YES
NO



-----Note-----

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

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

Source: codeforces | Difficulty: EASY
Tags: Greedy algorithms

Sorting

Data structures

Constructive algorithms


Solutions:
g = int(input())
for i in range(g):
	n = int(input())
	b = list(map(int, input().split()))
	if len(set(b)) < n:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	l = [int(k) for k in input().split()]
	s = set(l)
	if len(s) == len(l):
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	l = len(set(a))
	if n == l:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	a = []
	flag = 1
	if len(set(b)) < n:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	a = [*map(int, input().split())]
	f = set(a)
	if len(f) != n:
		print('YES')
	else:
		print('NO')


from collections import defaultdict
linp = lambda : list(map(int, input().split()))
iinp = lambda : int(input())
tinp = lambda : map(int, input().split())
rinp = lambda : range(int(input()))
dct = lambda : defaultdict(lambda : 0)
from collections import Counter
from math import ceil
for _ in rinp():
	n = iinp()
	l = linp()
	st = set(l)
	print('NO' if len(st) == n else 'YES')


for h in range(int(input())):
	n = int(input())
	arr = list(map(int, input().strip().split()))
	seti = set()
	for i in arr:
		if i in seti:
			print('YES')
			break
		else:
			seti.add(i)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	input()
	s = input().split()
	print('YNEOS'[len(s) == len(set(s))::2])


for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	d = {}
	f = 1
	for i in b:
		d[i] = d.get(i, 0) + 1
		if d[i] == 2:
			print('YES')
			f = 0
			break
	if f:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	f = 1
	for i in lst:
		if lst.count(i) > 1:
			print('YES')
			f = 0
			break
	if f:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	b = [int(i) for i in input().split()]
	if len(set(b)) < n:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	b = set(b)
	print('YES' if len(b) < n else 'NO')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	ans = []
	count = {}
	for i in range(n):
		if count.get(l[i]):
			count[l[i]].append((i, i))
			ans = count[l[i]]
			break
		else:
			count[l[i]] = [(i, i)]
	if ans:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	x = int(input())
	y = list(map(int, input().split()))
	z = []
	for q in y:
		if q in z:
			print('YES')
			break
		else:
			z.append(q)
	if len(z) == len(y):
		print('NO')


from collections import defaultdict as dd, deque as dq, Counter as c
from math import factorial as f, ceil, gcd, sqrt

def it():
	return int(input())

def mp():
	return map(int, input().split())
for _ in range(it()):
	a = it()
	b = list(mp())
	s = set(b)
	if len(s) != a:
		print('YES')
	else:
		print('NO')


import sys
import math
import collections
import bisect

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
for t in range(int(input())):
	n = int(input())
	arr = get_list()
	if len(set(arr)) == n:
		print('NO')
	else:
		print('YES')


import sys, math, itertools, collections, copy
input = sys.stdin.readline

def solve():
	N = int(input())
	b = [int(x) for x in input().split()]
	d = set()
	for i in range(N):
		if b[i] in d:
			print('YES')
			return
		d.add(b[i])
	print('NO')
for _ in range(int(input())):
	solve()


from collections import defaultdict as dd
for _ in range(int(input())):
	n = map(int, input().split())
	d = dd(int)
	for i in map(int, input().split()):
		d[i] += 1
		if d[i] >= 2:
			print('YES')
			break
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	s = set(b)
	f = 1
	for x in s:
		if b.count(x) > 1:
			print('YES')
			f = 0
			break
	if f:
		print('NO')


T = int(input())
for _ in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	st = set()
	ans = False
	for i in range(n):
		if a[i] in st:
			ans = True
			break
		st.add(a[i])
	print('YES' if ans else 'NO')


import math
from collections import defaultdict
from sys import stdin
input = stdin.readline
T = int(input())
for _ in range(T):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	f = 0
	for i in range(n - 1):
		if arr[i] == arr[i + 1]:
			f = 1
			break
	if f:
		print('YES')
	else:
		print('NO')


from math import factorial

class input_list(list):

	def add_v(self, v):
		self.append(v)
	add_v = property(fset=add_v, doc=add_v.__doc__)

def multiple_run(func, count=None):

	def dec():
		for _ in range(int(input()) if count is None else count):
			func()
	return dec

@multiple_run
def main():
	n = int(input())
	a = input().split()
	b = set(a)
	if len(b) != len(a):
		print('YES')
	else:
		print('NO')
main()


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
from collections import *
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True

def main():
	for _ in range(ii()):
		n = ii()
		a = li()
		if len(set(a)) == n:
			print('NO')
		else:
			print('YES')
main()


import math
import sys
inp = int(input())
for _ in range(inp):
	n = int(input())
	arr = list(map(int, input().split(' ')))
	visit = set()
	isit = True
	for i in arr:
		if i in visit:
			isit = False
			break
		else:
			visit.add(i)
	if isit:
		print('NO')
	else:
		print('YES')


def exists(b: list):
	if len(b) <= 1:
		return 'NO'
	d = set()
	double = []
	for i in b:
		if i in d:
			double.append(i)
		else:
			d.add(i)
	if double:
		return 'YES'
	return 'NO'
n = int(input())
for _ in range(n):
	_ = input()
	b = list(map(int, input().strip().split()))
	print(exists(b))


test_cases = int(input())
for test_case in range(test_cases):
	n = int(input())
	b = list(map(int, input().split()))
	b.sort()
	ans = 'NO'
	for i in range(n - 1):
		if b[i] == b[i + 1]:
			ans = 'YES'
	print(ans)


import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
mod = 10 ** 9 + 7

def lcm(x, y):
	return x * y / gcd(x, y)

def fact(x, mod=mod):
	ans = 1
	for i in range(1, x + 1):
		ans = ans * i % mod
	return ans

def arr2D(n, m, default=0):
	return [[default for j in range(m)] for i in range(n)]

def arr3D(n, m, r, default=0):
	return [[[default for k in range(r)] for j in range(m)] for i in range(n)]

def sortDictV(x):
	return {k: v for (k, v) in sorted(x.items(), key=lambda item: item[1])}

class DSU:

	def __init__(self, length):
		self.length = length
		self.parent = [-1] * self.length

	def getParent(self, node, start):
		if node >= self.length:
			return False
		if self.parent[node] < 0:
			if start != node:
				self.parent[start] = node
			return node
		return self.getParent(self.parent[node], start)

	def union(self, node1, node2):
		parent1 = self.getParent(node1, node1)
		parent2 = self.getParent(node2, node2)
		if parent1 == parent2:
			return False
		elif self.parent[parent1] <= self.parent[parent2]:
			self.parent[parent1] += self.parent[parent2]
			self.parent[parent2] = parent1
		else:
			self.parent[parent2] += self.parent[parent1]
			self.parent[parent1] = parent2
		return True

	def getCount(self, node):
		return -self.parent[self.getParent(node, node)]

def solve(n, lst):
	set1 = set(lst)
	if len(set1) == len(lst):
		return 'NO'
	return 'YES'
for _ in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	print(solve(n, lst))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	print('YES' if len(set(a)) != n else 'NO')


for b in [*open(0)][2::2]:
	d = {}
	ans = 'NO'
	for i in map(int, b.split()):
		if i not in d:
			d[i] = 1
		else:
			d[i] += 1
	for i in d:
		if d[i] > 1:
			ans = 'YES'
			break
	print(ans)


t = int(input())
cantidades = []
listas = []
for i in range(t):
	cantidades.append(int(input()))
	listas.append(input().split())
for i in range(t):
	if not len(listas[i]) == len(set(listas[i])):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	b.sort()
	flag = True
	for i in range(n - 1):
		if b[i] == b[i + 1]:
			print('YES')
			flag = False
			break
	if flag:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == n:
		print('No')
	else:
		print('Yes')


for __ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	ar.sort()
	ans = 'NO'
	for i in range(1, n):
		if ar[i] == ar[i - 1]:
			ans = 'YES'
			break
	print(ans)


from __future__ import division, print_function
import math
import os
import sys
from fractions import *
from sys import *
from decimal import *
from io import BytesIO, IOBase
from itertools import accumulate, combinations, permutations, combinations_with_replacement, product
from collections import *
import timeit, time
M = 10 ** 9 + 7
from heapq import *
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def inpu():
	return int(inp())

def regularbracket(t):
	p = 0
	for i in t:
		if i == '(':
			p += 1
		else:
			p -= 1
		if p < 0:
			return False
	else:
		if p > 0:
			return False
		else:
			return True

def binarySearchcount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def binarySearch(arr, n, key):
	left = 0
	right = n - 1
	while left <= right:
		mid = (right + left) // 2
		if arr[mid] == key:
			return mid
		if arr[mid] <= key:
			left = mid + 1
		else:
			right = mid - 1
	return -1

def ternarysearch(arr, n, key):
	(l, r) = (0, n - 1)
	while l <= r:
		mid = (-l + r) // 3 + l
		mid2 = mid + (-l + r) // 3
		if arr[mid] == key:
			return mid
		if arr[mid2] == key:
			return mid2
		if arr[mid] > key:
			r = mid - 1
		elif arr[mid2] < key:
			l = mid2 + 1
		else:
			l = mid + 1
			r = mid2 - 1
	return -1

def reverse1(string):
	pp = ''
	for i in string[::-1]:
		pp += i
	if pp == string:
		return True
	return False

def reverse2(list1):
	l = []
	for i in list1[::-1]:
		l.append(i)
	if l == list1:
		return True
	return False

def mex(list1):
	p = max(list1) + 1
	for i in range(len(list1)):
		if list1[i] != i:
			p = i
			break
	return p

def sumofdigits(n):
	n = str(n)
	s1 = 0
	for i in n:
		s1 += int(i)
	return s1

def perfect_square(n):
	s = math.sqrt(n)
	if s == int(s):
		return True
	return False

def roman_number(x):
	if x > 15999:
		return
	value = [5000, 4000, 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
	symbol = ['F', 'MF', 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
	roman = ''
	i = 0
	while x > 0:
		div = x // value[i]
		x = x % value[i]
		while div:
			roman += symbol[i]
			div -= 1
		i += 1
	return roman

def soretd(s):
	for i in range(1, len(s)):
		if s[i - 1] > s[i]:
			return False
	return True

def countRhombi(h, w):
	ct = 0
	for i in range(2, h + 1, 2):
		for j in range(2, w + 1, 2):
			ct += (h - i + 1) * (w - j + 1)
	return ct

def countrhombi2(h, w):
	return h * h // 4 * (w * w // 4)

def binpow(a, b):
	if b == 0:
		return 1
	else:
		res = binpow(a, b // 2)
	if b % 2 != 0:
		return res * res * a
	else:
		return res * res

def binpowmodulus(a, b, m):
	a %= m
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a = a * a % m
		b >>= 1
	return res

def coprime_to_n(n):
	result = n
	i = 2
	while i * i <= n:
		if n % i == 0:
			while n % i == 0:
				n //= i
			result -= result // i
		i += 1
	if n > 1:
		result -= result // n
	return result

def luckynumwithequalnumberoffourandseven(x, n, a):
	if x >= n and str(x).count('4') == str(x).count('7'):
		a.append(x)
	elif x < 1000000000000.0:
		luckynumwithequalnumberoffourandseven(x * 10 + 4, n, a)
		luckynumwithequalnumberoffourandseven(x * 10 + 7, n, a)
	return a

def luckynum(x, l, r, a):
	if x >= l and x <= r:
		a.append(x)
	if x > r:
		a.append(x)
		return a
	if x < 10000000000.0:
		luckynum(x * 10 + 4, l, r, a)
		luckynum(x * 10 + 7, l, r, a)
	return a

def luckynuber(x, n, a):
	p = set(str(x))
	if len(p) <= 2:
		a.append(x)
	if x < n:
		luckynuber(x + 1, n, a)
	return a

def interact(type, x):
	if type == 'r':
		inp = input()
		return inp.strip()
	else:
		print(x, flush=True)

def findTrailingZeros(n):
	count = 0
	while n >= 5:
		n //= 5
		count += n
	return count

def mergeSort(arr):
	if len(arr) > 1:
		mid = len(arr) // 2
		L = arr[:mid]
		R = arr[mid:]
		mergeSort(L)
		mergeSort(R)
		i = j = k = 0
		while i < len(L) and j < len(R):
			if L[i] < R[j]:
				arr[k] = L[i]
				i += 1
			else:
				arr[k] = R[j]
				j += 1
			k += 1
		while i < len(L):
			arr[k] = L[i]
			i += 1
			k += 1
		while j < len(R):
			arr[k] = R[j]
			j += 1
			k += 1
res = set()

def solven(p, l, a, b, n):
	if p > n or l > 10:
		return
	if p > 0:
		res.add(p)
	solven(p * 10 + a, l + 1, a, b, n)
	solven(p * 10 + b, l + 1, a, b, n)

def subsetsUtil(A, subset, index, d):
	print(*subset)
	s = sum(subset)
	d.append(s)
	for i in range(index, len(A)):
		subset.append(A[i])
		subsetsUtil(A, subset, i + 1, d)
		subset.pop(-1)
	return d

def subsetSums(arr, l, r, d, sum=0):
	if l > r:
		d.append(sum)
		return
	subsetSums(arr, l + 1, r, d, sum + arr[l])
	subsetSums(arr, l + 1, r, d, sum)
	return d

def print_factors(x):
	factors = []
	for i in range(1, x + 1):
		if x % i == 0:
			factors.append(i)
	return factors

def calc(X, d, ans, D):
	if len(X) == 0:
		return
	i = X.index(max(X))
	ans[D[max(X)]] = d
	Y = X[:i]
	Z = X[i + 1:]
	calc(Y, d + 1, ans, D)
	calc(Z, d + 1, ans, D)

def factorization(n, l):
	c = n
	if prime(n) == True:
		l.append(n)
		return l
	for i in range(2, c):
		if n == 1:
			break
		while n % i == 0:
			l.append(i)
			n = n // i
	return l

def good(b):
	l = []
	i = 0
	while len(b) != 0:
		if b[i] < b[len(b) - 1 - i]:
			l.append(b[i])
			b.remove(b[i])
		else:
			l.append(b[len(b) - 1 - i])
			b.remove(b[len(b) - 1 - i])
	if l == sorted(l):
		return True
	return False

def generate(st, s):
	if len(s) == 0:
		return
	if s not in st:
		st.add(s)
		for i in range(len(s)):
			t = list(s).copy()
			t.remove(s[i])
			t = ''.join(t)
			generate(st, t)
	return

def largestincreasingsubsequence(A):
	l = [1] * len(A)
	sub = []
	for i in range(1, len(l)):
		for k in range(i):
			if A[k] < A[i]:
				sub.append(l[k])
		l[i] = 1 + max(sub, default=0)
	return max(l, default=0)

def findOR(nums, N):
	prefix_sum = 0
	result = 0
	for i in range(N):
		result |= nums[i]
		prefix_sum += nums[i]
		result |= prefix_sum
	return result

def OR(a, n):
	ans = a[0]
	for i in range(1, n):
		ans |= a[i]
	return ans

def toString(List):
	return ''.join(List)

def permute(a, l, r, p):
	if l == r:
		p.append(toString(a))
	else:
		for i in range(l, r + 1):
			(a[l], a[i]) = (a[i], a[l])
			permute(a, l + 1, r)
			(a[l], a[i]) = (a[i], a[l])

def squareRoot(number, precision):
	start = 0
	(end, ans) = (number, 1)
	while start <= end:
		mid = int((start + end) / 2)
		if mid * mid == number:
			ans = mid
			break
		if mid * mid < number:
			start = mid + 1
		else:
			end = mid - 1
	increment = 0.1
	for i in range(0, precision):
		while ans * ans <= number:
			ans += increment
		ans = ans - increment
		increment = increment / 10
	return ans

def countRectangles(l, w):
	squareSide = math.gcd(l, w)
	return int(l * w / (squareSide * squareSide))

def count_same_digit(L, R):
	tmp = 0
	ans = 0
	n = int(math.log10(R) + 1)
	for i in range(0, n):
		tmp = tmp * 10 + 1
		for j in range(1, 10):
			if L <= tmp * j and tmp * j <= R:
				ans += 1
	return ans

def findCrossOver(arr, low, high, x):
	if arr[high] <= x:
		return high
	if arr[low] > x:
		return low
	mid = (low + high) // 2
	if arr[mid] <= x and arr[mid + 1] > x:
		return mid
	if arr[mid] < x:
		return findCrossOver(arr, mid + 1, high, x)
	return findCrossOver(arr, low, mid - 1, x)

def Kclosest(arr, x, k, n, ans):
	l = findCrossOver(arr, 0, n - 1, x)
	r = l + 1
	count = 0
	if arr[l] == x:
		l -= 1
	while l >= 0 and r < n and (count < k):
		if x - arr[l] < arr[r] - x:
			ans.append(arr[l])
			l -= 1
		else:
			ans.append(arr[r])
			r += 1
		count += 1
	while count < k and l >= 0:
		ans.append(arr[l])
		l -= 1
		count += 1
	while count < k and r < n:
		ans.append(arr[r])
		r += 1
		count += 1
	return ans

def prime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	for i in range(5, int(math.sqrt(n)) + 1, 2):
		if n % i == 0:
			return False
	return True

def main():
	for _ in range(inpu()):
		n = inpu()
		b = sorted(lis())
		if len(set(b)) == n:
			print('NO')
		else:
			print('YES')
main()


tests = int(input())
for t in range(tests):
	n = int(input())
	arr = [int(x) for x in input().split()]
	dic = dict()
	fl = False
	for i in arr:
		if i in dic:
			fl = True
			break
		else:
			dic[i] = 1
	if fl:
		print('YES')
	else:
		print('NO')


def solve():
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	prev = a[0]
	found = False
	for i in range(1, n):
		if a[i] == prev:
			found = True
			break
		else:
			prev = a[i]
	if found:
		print('YES')
	else:
		print('NO')
t = int(input())
for _ in range(t):
	solve()


import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	B = list(map(int, input().split()))
	return 'YES' if n > len(set(B)) else 'NO'
for _ in range(int(input())):
	print(solve())


for i in range(int(input())):
	arr = set()
	tot = 0
	n = int(input())
	for j in input().split():
		ele = int(j)
		arr.add(ele)
		tot += ele
	print('NO' if len(arr) == n else 'YES')


def ggwp(b):
	s = set()
	for i in b:
		if i in s:
			print('YES')
			return ''
		else:
			s.add(i)
	print('NO')
	return ''
for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	ggwp(b)


def main():
	n = int(input())
	b = list(map(int, input().split()))
	a = {}
	for i in range(n):
		a[b[i]] = 0
	for i in range(n):
		a[b[i]] += 1
	for i in range(n):
		if a[b[i]] >= 2:
			print('YES')
			return
	print('NO')
rw = int(input())
for wewq in range(rw):
	main()


t = int(input())
list = []
for i in range(t):
	n = int(input())
	list = [int(x) for x in input().split(' ')]
	s = set()
	for i in range(0, n):
		s.add(list[i])
	if len(s) == n:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	l1 = list(set(a))
	if len(a) == len(l1):
		print('NO')
	else:
		print('YES')


def panda(l, n):
	l1 = sorted(l)
	for i in range(n - 1):
		if l1[i + 1] == l1[i]:
			return 'YES'
	return 'NO'
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	print(panda(l, n))


a = int(input())
for i in range(a):
	b = int(input())
	c = list(map(int, input().split()))
	c.sort()

	def abc(c):
		for j in range(b - 1):
			if c[j] == c[j + 1]:
				return 'YES'
		return 'NO'
	print(abc(c))


for _ in range(int(input())):
	_ = int(input())
	elems = set()
	answer = False
	arr = map(int, input().split())
	for elem in arr:
		if elem in elems:
			answer = True
		elems.add(elem)
	if answer:
		print('YES')
	else:
		print('NO')


import sys, threading, os.path
import string
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)

def main():
	if os.path.exists('in.txt'):
		input = open('in.txt', 'r')
	else:
		input = sys.stdin
	n = int(input.readline())
	results = []
	for i in range(n):
		ni = int(input.readline())
		lis = list(map(int, input.readline().split()))
		set1 = set()
		flag = False
		for x in lis:
			if x in set1:
				flag = True
				break
			set1.add(x)
		if flag:
			results.append('YES')
		else:
			results.append('NO')
	output = '\n'.join((''.join(map(str, re)) for re in results))
	if os.path.exists('out.txt'):
		open('out.txt', 'w').writelines(str(output))
	else:
		sys.stdout.write(str(output))
main()


for _ in [0] * int(input()):
	n = int(input())
	s = set(map(int, input().split()))
	print(['NO', 'YES'][len(s) != n])


from functools import cmp_to_key
from collections import deque
from heapq import heappush, heappop
from math import log, ceil
import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def ii():
	return int(inp())

def li(lag=0):
	l = list(map(int, inp().split()))
	if lag != 0:
		for i in range(len(l)):
			l[i] += lag
	return l

def mi(lag=0):
	matrix = list()
	for i in range(n):
		matrix.append(li(lag))
	return matrix

def sli():
	return list(map(str, inp().split()))

def print_list(lista, space=' '):
	print(space.join(map(str, lista)))

class UnionFind:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		if self.size[a] < self.size[b]:
			(a, b) = (b, a)
		self.num_sets -= 1
		self.parent[b] = a
		self.size[a] += self.size[b]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def bisect_left(a, x):
	left = 0
	right = len(a)
	while left < right:
		mid = (left + right) // 2
		if a[mid] < x:
			left = mid + 1
		else:
			right = mid
	return left

def bisect_right(a, x):
	left = 0
	right = len(a)
	while left < right:
		mid = (left + right) // 2
		if a[mid] > x:
			right = mid
		else:
			left = mid + 1
	return left

def bisect_elements(a, x):
	return bisect_right(a, x) - bisect_left(a, x)

def custom_sort(lista):

	def cmp(x, y):
		if x + y > y + x:
			return 1
		else:
			return -1
	return sorted(lista, key=cmp_to_key(cmp))
MOD = 10 ** 9 + 7
maxN = 10 ** 5
FACT = [0] * maxN

def add(x, y):
	return (x + y) % MOD

def multiply(x, y):
	return x * y % MOD

def power(x, y):
	if y == 0:
		return 1
	elif y % 2:
		return multiply(x, power(x, y - 1))
	else:
		a = power(x, y // 2)
		return multiply(a, a)

def inverse(x):
	return power(x, MOD - 2)

def divide(x, y):
	return multiply(x, inverse(y))

def allFactorials():
	FACT[0] = 1
	for i in range(1, maxN):
		FACT[i] = multiply(i, FACT[i - 1])

def coeffBinom(n, k):
	if n < k:
		return 0
	return divide(FACT[n], multiply(FACT[k], FACT[n - k]))

def primes(N):
	smallest_prime = [1] * (N + 1)
	prime = []
	smallest_prime[0] = 0
	smallest_prime[1] = 0
	for i in range(2, N + 1):
		if smallest_prime[i] == 1:
			prime.append(i)
			smallest_prime[i] = i
		j = 0
		while j < len(prime) and i * prime[j] <= N:
			smallest_prime[i * prime[j]] = min(prime[j], smallest_prime[i])
			j += 1
	return (prime, smallest_prime)

def gcd(a, b):
	(s, t, r) = (0, 1, b)
	(old_s, old_t, old_r) = (1, 0, a)
	while r != 0:
		quotient = old_r // r
		(old_r, r) = (r, old_r - quotient * r)
		(old_s, s) = (s, old_s - quotient * s)
		(old_t, t) = (t, old_t - quotient * t)
	return (old_r, old_s, old_t)

def create_graph(n, m, undirected=1, unweighted=1):
	graph = [[] for i in range(n)]
	if unweighted:
		for i in range(m):
			[x, y] = li(lag=-1)
			graph[x].append(y)
			if undirected:
				graph[y].append(x)
	else:
		for i in range(m):
			[x, y, w] = li(lag=-1)
			w += 1
			graph[x].append([y, w])
			if undirected:
				graph[y].append([x, w])
	return graph

def create_tree(n, unweighted=1):
	children = [[] for i in range(n)]
	if unweighted:
		for i in range(n - 1):
			[x, y] = li(lag=-1)
			children[x].append(y)
			children[y].append(x)
	else:
		for i in range(n - 1):
			[x, y, w] = li(lag=-1)
			w += 1
			children[x].append([y, w])
			children[y].append([x, w])
	return children

def create_edges(m, unweighted=0):
	edges = list()
	if unweighted:
		for i in range(m):
			edges.append(li(lag=-1))
	else:
		for i in range(m):
			[x, y, w] = li(lag=-1)
			w += 1
			edges.append([w, x, y])
	return edges

def dist(tree, n, A, B=-1):
	s = [[A, 0]]
	(massimo, massimo_nodo) = (0, 0)
	distanza = -1
	v = [-1] * n
	while s:
		(el, dis) = s.pop()
		if dis > massimo:
			massimo = dis
			massimo_nodo = el
		if el == B:
			distanza = dis
		for child in tree[el]:
			if v[child] == -1:
				v[child] = 1
				s.append([child, dis + 1])
	return (massimo, massimo_nodo, distanza)

def diameter(tree):
	(_, foglia, _) = dist(tree, n, 0)
	(diam, _, _) = dist(tree, n, foglia)
	return diam

def dfs(graph, n, A):
	v = [-1] * n
	s = [[A, 0]]
	v[A] = 0
	while s:
		(el, dis) = s.pop()
		for child in graph[el]:
			if v[child] == -1:
				v[child] = dis + 1
				s.append([child, dis + 1])
	return v

def bfs(graph, n, A):
	v = [-1] * n
	s = deque()
	s.append([A, 0])
	v[A] = 0
	while s:
		(el, dis) = s.popleft()
		for child in graph[el]:
			if v[child] == -1:
				v[child] = dis + 1
				s.append([child, dis + 1])
	return v

def connected(graph, n):
	v = dfs(graph, n, 0)
	for el in v:
		if el == -1:
			return False
	return True

def topological(graph, n):
	indegree = [0] * n
	for el in range(n):
		for child in graph[el]:
			indegree[child] += 1
	s = deque()
	for el in range(n):
		if indegree[el] == 0:
			s.append(el)
	order = []
	while s:
		el = s.popleft()
		order.append(el)
		for child in graph[el]:
			indegree[child] -= 1
			if indegree[child] == 0:
				s.append(child)
	if n == len(order):
		return (False, order)
	else:
		return (True, [])

def bipartite(graph, n):
	color = [-1] * n
	color[0] = 0
	s = [0]
	while s:
		el = s.pop()
		for child in graph[el]:
			if color[child] == color[el]:
				return False
			if color[child] == -1:
				s.append(child)
			color[child] = 1 - color[el]
	return True

def dijkstra(graph, n, A):
	dist = [float('inf') for i in range(n)]
	prev = [-1 for i in range(n)]
	dist[A] = 0
	pq = []
	heappush(pq, [0, A])
	while pq:
		[d_v, v] = heappop(pq)
		if d_v != dist[v]:
			continue
		for (to, w) in graph[v]:
			if dist[v] + w < dist[to]:
				dist[to] = dist[v] + w
				prev[to] = v
				heappush(pq, [dist[to], to])
	return (dist, prev)

def dijkstra_0_1(graph, n, A):
	dist = [float('inf') for i in range(n)]
	dist[A] = 0
	p = deque()
	p.append(A)
	while p:
		v = p.popleft()
		for (to, w) in graph[v]:
			if dist[v] + w < dist[to]:
				dist[to] = dist[v] + w
			if w == 1:
				q.append(to)
			else:
				q.appendleft(to)
	return dist

def floyd_warshall(graph, n):
	dist = [[float('inf') for _ in range(n)] for _ in range(n)]
	for i in range(n):
		dist[i][i] = 0
		for (child, d) in graph[i]:
			dist[i][child] = d
			dist[child][i] = d
	for k in range(n):
		for i in range(n):
			for j in range(j):
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])
	return dist

def minimum_spanning_tree(edges, n):
	edges = sorted(edges)
	union_find = UnionFind(n)
	used_edges = list()
	for (w, x, y) in edges:
		if union_find.find(x) != union_find.find(y):
			union_find.merge(x, y)
			used_edges.append([w, x, y])
	return used_edges

def parents_children_root_unrooted_tree(tree, n, root=0):
	q = deque()
	visited = [0] * n
	parent = [-1] * n
	children = [[] for i in range(n)]
	q.append(root)
	while q:
		all_done = 1
		visited[q[0]] = 1
		for child in tree[q[0]]:
			if not visited[child]:
				all_done = 0
				q.appendleft(child)
		if all_done:
			for child in tree[q[0]]:
				if parent[child] == -1:
					parent[q[0]] = child
					children[child].append(q[0])
			q.popleft()
	return (parent, children)

def all_longest_path_passing_from_node(parent, children, n):
	q = deque()
	visited = [len(children[i]) for i in range(n)]
	downwards = [[0, 0] for i in range(n)]
	upward = [1] * n
	longest_path = [1] * n
	for i in range(n):
		if not visited[i]:
			q.append(i)
			downwards[i] = [1, 0]
	while q:
		node = q.popleft()
		if parent[node] != -1:
			visited[parent[node]] -= 1
			if not visited[parent[node]]:
				q.append(parent[node])
		else:
			root = node
		for child in children[node]:
			downwards[node] = sorted([downwards[node][0], downwards[node][1], downwards[child][0] + 1], reverse=True)[0:2]
	s = [node]
	while s:
		node = s.pop()
		if parent[node] != -1:
			if downwards[parent[node]][0] == downwards[node][0] + 1:
				upward[node] = 1 + max(upward[parent[node]], downwards[parent[node]][1])
			else:
				upward[node] = 1 + max(upward[parent[node]], downwards[parent[node]][0])
		longest_path[node] = downwards[node][0] + downwards[node][1] + upward[node] - min([downwards[node][0], downwards[node][1], upward[node]]) - 1
		for child in children[node]:
			s.append(child)
	return longest_path

def finding_ancestors(parent, queries, n):
	steps = int(ceil(log(n, 2)))
	ancestors = [[-1 for i in range(n)] for j in range(steps)]
	ancestors[0] = parent
	for i in range(1, steps):
		for node in range(n):
			if ancestors[i - 1][node] != -1:
				ancestors[i][node] = ancestors[i - 1][ancestors[i - 1][node]]
	result = []
	for (node, k) in queries:
		ans = node
		if k >= n:
			ans = -1
		i = 0
		while k > 0 and ans != -1:
			if k % 2:
				ans = ancestors[i][ans]
			k = k // 2
			i += 1
		result.append(ans)
	return result

def prefix_sum(arr):
	r = [0] * (len(arr) + 1)
	for (i, el) in enumerate(arr):
		r[i + 1] = r[i] + el
	return r

def nearest_from_the_left_smaller_elements(arr):
	n = len(arr)
	res = [-1] * n
	s = []
	for (i, el) in enumerate(arr):
		while s and s[-1] >= el:
			s.pop()
		if s:
			res[i] = s[-1]
		s.append(el)
	return res

def sliding_window_minimum(arr, k):
	res = []
	q = deque()
	for (i, el) in enumerate(arr):
		while q and arr[q[-1]] >= el:
			q.pop()
		q.append(i)
		while q and q[0] <= i - k:
			q.popleft()
		if i >= k - 1:
			res.append(arr[q[0]])
	return res
t = ii()
for test in range(t):
	n = ii()
	b = li()
	v = set()
	flag = False
	for i in range(n):
		if b[i] in v:
			print('YES')
			flag = True
			break
		v.add(b[i])
	if flag == False:
		print('NO')


T = int(input())
for _ in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	wrong = False
	mp = {}
	for i in a:
		if i in mp:
			wrong = True
			break
		mp[i] = True
	if wrong:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	x = int(input())
	(*li,) = map(int, input().split())
	set1 = set(li)
	print('YES' if len(li) != len(set1) else 'NO')


t = int(input())
res = []
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if len(a) == len(set(a)):
		res.append('NO')
	else:
		res.append('YES')
for i in res:
	print(i)


import sys
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right, bisect_left
import math
from operator import itemgetter
from heapq import heapify, heappop, heappush
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	x = dc(int)
	f = 0
	for i in l:
		if x[i] == 1:
			f = 1
			break
		else:
			x[i] = 1
	if f:
		print('YES')
	else:
		print('NO')


x = int(input())
while x > 0:
	x = x - 1
	j = int(input())
	l = list(map(int, input().split()))
	s = 'YES'
	l = list(set(l))
	if len(l) == j:
		s = 'NO'
	print(s)


for _ in range(int(input())):
	input()
	a = []
	for i in map(int, input().split()):
		a.append(i)
	b = set(a)
	if len(a) == len(b):
		print('NO')
	else:
		print('YES')


def solve(arr):
	pass

def driver():
	t = int(input())
	for _ in range(t):
		n = int(input())
		arr = list(map(int, input().split()))
		if len(set(arr)) < len(arr):
			print('YES')
		else:
			print('NO')

def test():
	print(solve([4, 3, 0, 1, 2, 0]))
driver()


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = {}
	ans = 'No'
	for i in a:
		b[i] = 0
	for i in a:
		b[i] += 1
		if b[i] > 1:
			ans = 'Yes'
			break
	print(ans)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	dic = {}
	for d in arr:
		if d not in dic:
			dic[d] = 0
		dic[d] += 1
	fl = 0
	for d in dic:
		if dic[d] >= 2:
			print('YES')
			fl = 1
			break
	if fl == 0:
		print('NO')


from sys import stdin, stdout, stderr, maxsize
tup = lambda : map(int, stdin.readline().split())
I = lambda : int(stdin.readline())
lint = lambda : [int(x) for x in stdin.readline().split()]
S = lambda : stdin.readline().replace('\n', '').strip()
stpr = lambda x: stdout.write(f'{x}' + '\n')
star = lambda x: print(' '.join(map(str, x)))
from math import ceil, floor
from _collections import defaultdict
from bisect import bisect_left, bisect_right
from math import log2
for _ in range(I()):
	n = I()
	b = lint()
	if len(set(b)) != n:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	s = list(set(li))
	if len(s) == n:
		print('NO')
	else:
		print('YES')


def fun(ls):
	if len(set(ls)) < len(ls):
		print('yes')
	else:
		print('no')
T = int(input())
for i in range(T):
	t = int(input())
	ls = list(map(int, input().split()))
	fun(ls)


def meme(l):
	x = sorted(l)
	for i in range(1, len(x), 1):
		if x[i] == x[i - 1]:
			return 'YES'
			break
	return 'NO'
x = int(input())
m = []
for i in range(x):
	y = input()
	z = input()
	z1 = z.split(' ')
	z2 = [int(t) for t in z1]
	m.append(z2)
for j in range(x):
	print(meme(m[j]))


def f():
	n = int(input())
	for i in range(n):
		t = int(input())
		arr = [int(x) for x in input().split()]
		arr.sort()
		for i in range(t - 1):
			if arr[i] == arr[i + 1]:
				print('YES')
				break
			elif i == t - 2:
				print('NO')
f()


t = int(input())
for _ in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	s = set()
	ans = 'NO'
	for i in b:
		if not i in s:
			s.add(i)
		else:
			ans = 'YES'
			break
	print(ans)


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	arr = map(int, input().split())
	print('YES' if Counter(arr).most_common(1)[0][1] > 1 else 'NO')


t = int(input())
while t > 0:
	n = int(input())
	l = list(map(int, input().split()))
	f = 0
	l.sort()
	for i in range(1, n):
		if l[i] == l[i - 1]:
			f = 1
			break
	if f == 1:
		print('YES')
	else:
		print('NO')
	t -= 1


for x in range(0, int(input())):
	i = int(input())
	l = list(map(int, input().split()))
	if i == len(set(l)):
		print('NO')
	else:
		print('YES')


def ggwp(b):
	d = dict()
	for i in b:
		try:
			if d[i] == 1:
				print('YES')
				return ''
		except:
			d[i] = 1
	print('NO')
	return ''
for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	ggwp(b)


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
import time
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict as dd, deque as dq, Counter as dc
import math, string

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())

def getMat(n):
	return [getInts() for _ in range(n)]
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	B = getInts()
	if len(set(B)) == N:
		return 'NO'
	return 'YES'
for _ in range(getInt()):
	print(solve())


from collections import defaultdict as dd
import sys
input = sys.stdin.readline
t = int(input())
while t:
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == len(l):
		print('NO')
	else:
		print('YES')
	t -= 1


import sys
input = sys.stdin.readline

def main():
	n = int(input())
	blst = list(map(int, input().split()))
	blst.sort()
	bef = -1
	for b in blst:
		if b == bef:
			print('YES')
			return
		bef = b
	print('NO')
for _ in range(int(input())):
	main()


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	temp = set(arr)
	if len(temp) != n:
		print('YES')
	else:
		print('NO')


d = int(input())
for t in range(d):
	n = int(input())
	lst = [int(i) for i in input().split()]
	if n != len(set(lst)):
		print('YES')
	else:
		print('NO')


tc = int(input())
while tc:
	n = int(input())
	a = set(map(int, input().split()))
	tc = tc - 1
	if len(a) == n:
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	int(input())
	l = input().split()
	print(['YES', 'NO'][len(set(l)) == len(l)])


from os import path
import sys, time
from math import ceil, floor, gcd, log, log2, factorial, sqrt
from collections import defaultdict, Counter, OrderedDict, deque
from itertools import combinations, accumulate
from bisect import *
from functools import reduce
from operator import mul
star = lambda x: print(' '.join(map(str, x)))
grid = lambda r: [lint() for i in range(r)]
INF = float('inf')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
import sys
from sys import stdin, stdout
from collections import *
from math import gcd, floor, ceil

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def inlt():
	return list(map(int, stdin.readline().split()))

def invr():
	return map(int, stdin.readline().split())

def solve():
	n = inp()
	a = inlt()
	a.sort()
	if len(set(a)) == n:
		print('NO')
		return
	d = Counter(a)
	for (i, j) in d.items():
		if j > 1:
			print('YES')
			return
	print('NO')
t = 1
t = inp()
for _ in range(t):
	solve()


for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	s = set()
	flag = 0
	for i in b:
		if i in s:
			flag = 1
			break
		else:
			s.add(i)
	if flag == 1:
		print('YES')
	else:
		print('NO')


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
from copy import deepcopy

def gift():
	for _ in range(t):
		n = int(input())
		arry = list(map(int, input().split()))
		dic = {}
		for ele in arry:
			ans = dic.get(ele, False)
			if ans:
				break
			else:
				dic[ele] = True
		if ans:
			yield 'YES'
		else:
			yield 'NO'
t = int(input())
ans = gift()
print(*ans, sep='\n')


def Valerii(n, b):
	d = {}
	for i in b:
		d[i] = d.get(i, 0) + 1
	for i in d:
		if d[i] > 1:
			return True
	return False
t = int(input())
for _ in range(t):
	n = int(input())
	b = [int(i) for i in input().split()]
	if Valerii(n, b):
		print('Yes')
	else:
		print('No')


try:
	t = int(input())
	for _ in range(t):
		n = int(input())
		b = list(map(int, input().split()))
		s = set(b)
		if len(s) == n:
			print('NO')
		else:
			print('YES')
except:
	pass


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	x = 0
	ans = 0
	for i in range(n):
		x = a.count(a[i])
		if x > 1:
			ans = 1
			print('YES')
			break
	if ans == 0:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	b_arr = list(map(int, input().split()))
	dupl = set()
	broken = False
	for i in b_arr:
		if i in dupl:
			print('YES')
			broken = True
			break
		dupl.add(i)
	if not broken:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	l = [int(x) for x in input().split()]
	s = set(l)
	if len(s) != len(l):
		print('YES')
	else:
		print('NO')


for tc in range(int(input())):
	n = int(input())
	arr = input().split()
	if len(arr) != len(set(arr)):
		print('YES')
	else:
		print('NO')


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		s = list(map(int, input().split()))
		ss = set()
		for i in s:
			if i in ss:
				print('YES')
				break
			else:
				ss.add(i)
		else:
			print('NO')
main()


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	c = Counter(l)
	p = c.values()
	for i in p:
		if i >= 2:
			print('YES')
			break
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	b.sort()
	ok = False
	for i in range(1, n):
		ok |= b[i] == b[i - 1]
	print('YES' if ok else 'NO')


for i in range(int(input())):
	t = int(input())
	s = list(input().split())
	s1 = list(set(s))
	s.sort()
	s1.sort()
	if s != s1:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)

def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		d = {}
		f = 0
		for i in a:
			if i in d:
				print('YES')
				f = 1
				break
			else:
				d[i] = 1
		if f == 0:
			print('NO')
	return
main()


t = int(input())
while t:
	n = int(input())
	a = list(map(int, input().split()))
	b = {}
	flag = 0
	for i in range(n):
		if a[i] in b:
			b[a[i]] += 1
		else:
			b[a[i]] = 1
	for i in b:
		if b[i] > 1:
			flag = 1
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')
	t -= 1


def sort(lst):
	for i in range(len(lst)):
		a = lst[i]
		for j in range(i + 1, len(lst)):
			if lst[j] < a:
				a = lst[j]
				(lst[i], lst[j]) = (lst[j], lst[i])
	return lst
import sys
t = int(sys.stdin.readline())
for j in range(t):
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	sorted_a = sort(a)
	kt = False
	k = 0
	for i in range(len(sorted_a) - 1):
		if sorted_a[i] != sorted_a[i + 1]:
			k += 1
			continue
		else:
			print('YES')
			break
	if k == len(sorted_a) - 1:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	b = sorted(list(map(int, input().split())))
	flag = False
	for i in range(n - 1):
		if b[i] == b[i + 1]:
			flag = True
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	b = False
	n = int(input())
	s_string = input()
	s_int = s_string.split(' ')
	x = [int(j) for j in s_int]
	x.sort()
	for j in range(n - 1):
		if x[j] == x[j + 1]:
			b = True
			break
	if b:
		print('YES')
	else:
		print('NO')


from collections import Counter as C
t = int(input())
for _ in range(t):
	n = int(input())
	b = [int(x) for x in input().split()]
	cnts = C(b)
	ans = 'NO'
	for v in cnts.values():
		if v > 1:
			ans = 'YES'
	print(ans)


num_inp = lambda : int(input())
arr_inp = lambda : list(map(int, input().split()))
sp_inp = lambda : map(int, input().split())
str_inp = lambda : input()
for _ in range(int(input())):
	print(['NO', 'YES'][int(input()) != len(set(input().split()))])


for _ in range(int(input())):
	print('NO' if int(input()) == len(set(input().split())) else 'YES')


for t in range(int(input())):
	n = int(input())
	if n == len(set(map(int, input().split()))):
		print('NO')
	else:
		print('YES')


t = int(input())
for p in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	dic = {}
	i = 0
	while i < n:
		k = dic.get(a[i], 0)
		if k == 0:
			dic[a[i]] = 1
		else:
			print('YES')
			break
		i += 1
	if i == n:
		print('NO')


import sys

def input():
	return sys.stdin.readline()

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	for i in range(n - 1):
		if a[i] == a[i + 1]:
			print('YES')
			return
	print('NO')
	return

def main():
	t = int(input())
	for i in range(t):
		solve()
	return
main()


t = int(input())
for i in range(t):
	n = int(input())
	d = {}
	l = [int(x) for x in input().split()]
	for i in l:
		if i not in d:
			d[i] = 1
		else:
			d[i] += 1
	ans = 0
	for (k, v) in d.items():
		if v > 1:
			ans = 1
			break
	if ans == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	res = 'NO'
	b = list(map(int, input().split()))
	for i in range(n):
		el = b[i]
		for j in range(i + 1, n):
			if el == b[j]:
				res = 'YES'
				break
	print(res)


import sys

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()

def get_int():
	return int(sys.stdin.readline().strip())

def get_print_int(x):
	sys.stdout.write(str(x))

def get_print(x):
	sys.stdout.write(str(x))

def solve():
	for _ in range(get_int()):
		n = get_int()
		arr = get_list()
		if n != len(set(arr)):
			get_print('YES\n')
		else:
			get_print('NO\n')
solve()


def fun(a, l):
	if len(set(l)) == len(l):
		return 'NO'
	else:
		return 'YES'
for t in range(int(input())):
	a = int(input())
	l = list(map(int, input().split()))
	print(fun(a, l))


from collections import defaultdict
n = int(input())
for i in range(n):
	a = defaultdict(int)
	_ = input()
	for j in list(map(int, input().split())):
		a[j] += 1
	for i in a.values():
		if i > 1:
			print('YES')
			break
	else:
		print('NO')


import sys
input = sys.stdin.buffer.readline

def solution():
	n = int(input())
	d = {}
	l = list(map(int, input().split()))
	for i in range(n):
		if d.get(l[i], 0) != 0:
			print('YES')
			return
		d[l[i]] = 1
	print('NO')
t = int(input())
for _ in range(t):
	solution()


from sys import stdin, stdout
import math, sys, heapq
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import random
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return list(map(int, input().split()))
else:

	def I():
		return int(stdin.readline())

	def In():
		return list(map(int, stdin.readline().split()))

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gt(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return -1

def main():
	try:
		n = I()
		l = list(In())
		z = set()
		flag = 0
		for x in l:
			if x not in z:
				z.add(x)
			else:
				flag = 1
				break
		if flag:
			yes()
		else:
			no()
	except:
		pass
M = 998244353
P = 1000000007

def __starting_point():
	for _ in range(I()):
		main()
__starting_point()


n = int(input())
thing = []
for d in range(n):
	thing.append(0)
	a = int(input())
	c = list(map(int, input().split()))
	for x in c:
		if c.count(x) > 1:
			thing[d] = 1
			break
for _ in range(n):
	if thing[_] == 0:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	li = list(map(int, input().split(' ')))
	li.sort()
	res = 0
	for x in range(len(li) - 1):
		if li[x] == li[x + 1]:
			res = 1
			break
	if res:
		print('YES')
	else:
		print('NO')


k_set = int(input())
for _ in range(k_set):
	lenth = int(input())
	data = list(map(int, input().split()))
	if len(set(data)) < len(data):
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	a = [int(i) for i in input().split()]
	b = set(a)
	if len(b) == len(a):
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	c = 1
	for k in range(n):
		if a.count(a[k]) > 1:
			print('YES')
			c = 0
			break
	if c:
		print('NO')


import math
import collections
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect_left as bsl
from bisect import bisect_right as bsr
import heapq as hq
setrecursionlimit(2 ** 20)
t = 1
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().rstrip().split()))
	d = {}
	chk = False
	for i in a:
		if i not in d:
			d[i] = 0
		else:
			chk = True
		d[i] += 1
	if chk:
		print('YES')
	else:
		print('NO')


def fun(a):
	d = {}
	for i in range(len(a)):
		try:
			d[a[i]] += 1
			return 'YES'
		except:
			d[a[i]] = 1
	return 'NO'
y122 = int(input())
for _ in range(y122):
	a = input()
	a = list(map(int, input().split()))
	print(fun(a))


def solve(arr, n):
	return 'Yes' if len(arr) != n else 'No'
for _ in range(int(input())):
	n = int(input())
	arr = set(map(int, input().split()))
	print(solve(arr, n))


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')
t = ip()
for _ in range(t):
	n = ip()
	arr = list(inp())
	if len(set(arr)) == n:
		ans = 'NO'
	else:
		ans = 'YES'
	out(ans)


def solve(n, a):
	s = set((x for x in a))
	return 'NO' if len(s) == n else 'YES'
t = int(input())
while t:
	n = int(input())
	a = list(map(int, input().split()))
	print(solve(n, a))
	t -= 1


from collections import defaultdict
for t in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	d = defaultdict(int)
	for x in b:
		d[x] += 1
	ok = False
	for v in d.values():
		if v > 1:
			ok = True
			break
	print('YES' if ok else 'NO')


import sys
t = int(input())
for num in range(t):
	n = int(sys.stdin.readline())
	lsb = list(map(int, sys.stdin.readline().split()))
	if len(set(lsb)) == len(lsb):
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	A = set(map(int, input().split()))
	print('YES' if len(A) < n else 'NO')


for i in range(int(input())):
	a = int(input())
	fl = 0
	arr = sorted(list(map(int, input().split())))
	for i in range(a - 1):
		if arr[i] == arr[i + 1]:
			fl = 1
	print('YES' if fl == 1 else 'NO')


a = int(input())
for i in range(a):
	fl = True
	n = int(input())
	c = [int(x) for x in input().split()]
	d = {}
	for j in c:
		d[j] = d.get(j, 0) + 1
		if d[j] == 2:
			print('YES')
			fl = False
			break
	if fl:
		print('NO')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	if y == 0:
		return 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal

def solve():
	n = scanner()
	a = get_list()
	if len(set(a)) == n:
		print('NO')
	else:
		print('YES')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = scanner()
for i in range(t):
	solve()


import sys
import itertools as it
import math as mt
import bisect as bi
import collections as cc
import itertools as it
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(n,) = I()
	l = I()
	ans = 'NO'
	c = cc.Counter(l)
	for i in c:
		if c[i] > 1:
			ans = 'YES'
	print(ans)


t = int(input())
for f in range(t):
	n = int(input())
	li = list(map(int, input().split()))
	li.sort()
	flag = False
	for i in range(n - 1):
		if li[i] == li[i + 1]:
			flag = True
	if flag:
		print('YES')
	else:
		print('NO')


T = int(input())
for t in range(0, T):
	n = int(input())
	b = list(map(int, input().split()))
	b.sort()
	flag = 0
	for i in range(0, n - 1):
		if b[i] == b[i + 1]:
			flag = 1
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	lens = int(input())
	arrs = [int(x) for x in input().split()]
	print(['YES', 'NO'][len(set(arrs)) == lens])


t = int(input())
while t > 0:
	s = ''
	a = int(input())
	l = list(map(int, input().split()))
	l.sort()
	x = list(dict.fromkeys(l))
	if len(x) == len(l):
		print('NO')
	else:
		print('YES')
	t -= 1


from math import ceil
t = int(input())
for _ in range(t):
	n = int(input())
	b = list(map(int, input().split(' ')))
	digits = set()
	ans = 'NO'
	for i in b:
		if i in digits:
			ans = 'YES'
			break
		else:
			digits.add(i)
	print(ans)


def solve():
	n = int(input().strip())
	b = [int(x) for x in input().strip().split()]
	b.sort()
	for i in range(n - 1):
		if b[i] == b[i + 1]:
			return 'YES'
	return 'NO'
for _ in range(int(input().strip())):
	print(solve())


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	temp = Counter(arr)
	f = 0
	for i in arr:
		if temp[i] > 1:
			f = 1
			break
	if f == 1:
		print('YES')
	else:
		print('NO')


import sys
from copy import *
from bisect import *
from math import gcd, ceil, sqrt
from itertools import permutations as prm, product

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')
di = [[-1, 0], [1, 0], [0, 1], [0, -1]]

def string(s):
	return ''.join(s)

def fori(n):
	return [fi() for i in range(n)]

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def bo(i):
	return ord(i) - ord('A')

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def gtc(tc, ans):
	print('Case #' + str(tc) + ':', ans)

def cil(n, m):
	return n // m + int(n % m > 0)

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

def gh():
	sys.stdout.flush()

def isvalid(i, j, n, m):
	return 0 <= i < n and 0 <= j < m

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = fi()
while t > 0:
	t -= 1
	n = fi()
	a = li()
	print('YES' if len(a) > len(set(a)) else 'NO')


import sys

def ints():
	return list(map(int, sys.stdin.readline().strip().split()))
tc = int(input())
while tc:
	tc -= 1
	n = int(input())
	ls = ints()
	if len(set(ls)) == n:
		print('NO')
	else:
		print('YES')


import sys
input = sys.stdin.buffer.readline
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))
rs = lambda : input().decode().rstrip('\n\r')
wrt = sys.stdout.write
pr = lambda *args, end='\n': wrt(' '.join([str(x) for x in args]) + end)
xrange = lambda args: reversed(range(args))
cdiv = lambda x, y: -(-x // y)
enum = enumerate
inf = float('inf')
mod = 10 ** 9 + 7
from collections import defaultdict as dd
Cases = ri()
for Case in range(Cases):
	n = ri()
	b = rl()
	vis = set()
	for i in b:
		if i in vis:
			print('YES')
			break
		vis.add(i)
	else:
		print('NO')


import sys
inp = sys.stdin.readline
for _ in range(int(inp())):
	n = int(inp())
	data = sorted(map(int, inp().split()))
	flag = False
	for i in range(1, n):
		if data[i] == data[i - 1]:
			flag = True
			break
	if flag:
		print('YES')
	else:
		print('NO')


for tetscase in range(int(input())):
	n = int(input())
	arr = [int(x) for x in input().split()]
	d = {}
	for ele in arr:
		if ele in d:
			print('YES')
			break
		else:
			d[ele] = 1
	else:
		print('NO')


import math
from sys import *
for _ in range(int(input())):
	n = int(stdin.readline())
	m = list(map(int, iter(stdin.readline().split())))
	(dict, f) = ({}, 0)
	for i in m:
		if i in dict:
			dict[i] += 1
		else:
			dict[i] = 1
	for (key, values) in dict.items():
		if values >= 2:
			f = 1
	if f == 1:
		stdout.write(str('yes') + '\n')
	else:
		stdout.write(str('no') + '\n')


s = int(input())
for __ in range(s):
	a = 0
	b = list()
	bb = list()
	n = int(input())
	ss = input()
	b = ss.split()
	for num in range(n):
		b[num] = int(b[num])
	bb = sorted(b)
	for numm in range(0, n - 1, 1):
		if bb[numm] == bb[numm + 1]:
			a = 1
			break
	if a == 0:
		print('NO')
	else:
		print('YES')


from sys import stdin, stdout
import heapq as hq
from collections import defaultdict
t = int(input())
for tc in range(t):
	n = int(stdin.readline())
	ar = list(map(int, stdin.readline().split()))
	res = False
	d = {}
	for v in ar:
		if d.get(v, False):
			res = True
			break
		d[v] = True
	if res:
		r = 'YES'
	else:
		r = 'NO'
	stdout.write(str(r) + '\n')


from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	di = {}
	counter = 0
	for i in range(n):
		if arr[i] in di:
			print('YES')
			counter = 1
			break
		di[arr[i]] = 1
	if counter == 0:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	mas = [int(s) for s in input().split()]
	k = False
	for i in range(n):
		if mas.count(mas[i]) > 1:
			k = True
			break
	if k:
		print('YES')
	else:
		print('NO')


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for k in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for k in range(c)] for k in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** (-10)
for _ in range(INT()):
	N = INT()
	A = LIST()
	if len(set(A)) != N:
		YES()
	else:
		NO()


for i in range(int(input())):
	a = int(input())
	b = list(map(int, input().split()))
	print('NYOE S'[1 - (len(b) == len(set(b)))::2])


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	c = 0
	for j in range(1, n):
		if a[j] == a[j - 1]:
			c = c + 1
	if c > 0:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	s = set(l)
	if len(s) == n:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	c = 0
	for i in range(0, n - 1):
		for j in range(i + 1, n):
			if b[i] == b[j]:
				c = 1
				break
	if c == 1:
		print('YES')
	else:
		print('NO')


mod = 10 ** 9 + 7
import sys
input = sys.stdin.readline
for nt in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == n:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	n = int(input())
	st = input()
	print('YES' if len(set(st.split())) != n else 'NO')


import sys, os
import heapq, functools, collections
import math, random
from collections import Counter, defaultdict

def solve_(lst):
	if len(set(lst)) == len(lst):
		return 'NO'
	return 'YES'

def console(*args):
	print('\x1b[36m', *args, '\x1b[0m', file=sys.stderr)
	pass
ONLINE_JUDGE = False
if os.path.exists('input.txt'):
	ONLINE_JUDGE = True
if ONLINE_JUDGE:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def console(*args):
		pass

def solve(*args):
	if not ONLINE_JUDGE:
		console('----- solving ------')
		console(*args)
		console('----- ------- ------')
	return solve_(*args)
if True:
	inp = iter(sys.stdin.buffer.readlines())
	input = lambda : next(inp)
else:
	input = sys.stdin.buffer.readline
for case_num in range(int(input())):
	k = int(input())
	lst = list(map(int, input().split()))
	res = solve(lst)
	print(res)


fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(z, zz) = (input, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from re import *
from sys import *
from math import *
from heapq import *
from queue import *
from bisect import *
from string import *
from itertools import *
from collections import *
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from collections import Counter as cc
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer):
	stdout.write(str(answer))
num = int(z())
for _ in range(num):
	n = int(z())
	if len(set(zzz())) == n:
		print('NO')
	else:
		print('YES')


def read(t=int):
	lis = input().strip().split()
	return list(map(t, lis))

def go():
	n = read()[0]
	b = read()
	s = set(b)
	if len(s) == len(b):
		return print('NO')
	print('YES')
t = read()[0]
for _ in range(t):
	go()


t = int(input())
for i in range(t):
	n = int(input())
	b = list(map(int, input().strip().split(' ')))
	a = list(dict.fromkeys(b))
	if len(a) == len(b):
		print('NO')
	else:
		print('YES')


n = int(input())
for i in range(n):
	le = int(input())
	arr = [int(_) for _ in input('').split()]
	s = set(arr)
	if len(s) < len(arr):
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	if len(set(arr)) != n:
		print('YES')
		continue
	print('NO')


def proveWrong(n, b):
	seen = set()
	for i in b:
		if i in seen:
			return 'YES'
		else:
			seen.add(i)
	return 'NO'
t = int(input())
for i in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	print(proveWrong(n, b))


import sys
import heapq
import copy
import math
import decimal
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def insr2():
	s = input()
	s = list(s[:len(s) - 1])
	s = [ord(s[i]) - ord('a') for i in range(len(s))]
	return s

def invr():
	return map(int, input().split())

def pr_list(a):
	print(*a, sep=' ')

def solve():
	n = inp()
	b = inlt()
	b.sort()
	flag = 0
	for i in range(1, n):
		if b[i] == b[i - 1]:
			flag = 1
			break
	if flag == 0:
		print('NO')
	else:
		print('YES')

def main():
	test = 1
	test = inp()
	for i in range(test):
		solve()
main()


l = int(input())
for _ in range(l):
	n = int(input())
	x = list(map(int, input().split()))
	d = {}
	flag = 0
	for i in range(len(x)):
		try:
			d[x[i]] += 1
			print('YES')
			flag = 1
			break
		except:
			d[x[i]] = 1
	if flag == 0:
		print('No')


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def solve():
	n = int(input())
	lst = list(map(int, input().split(' ')))
	if len(lst) != len(set(lst)):
		print('YES')
	else:
		print('NO')

def main():
	testcases = 1
	testcases = int(input())
	for _ in range(testcases):
		solve()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def solve():
	n = int(input())
	l = list(map(int, input().split()))
	if len(set(l)) == n:
		return 'NO'
	else:
		return 'YES'
for _ in range(int(input())):
	print(solve())


import sys

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math
from collections import defaultdict
for _ in range(ri()):
	n = ri()
	l = ria()
	if n != len(set(l)):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	s = set()
	flag = 0
	for i in l:
		if i in s:
			flag = 1
			break
		else:
			s.add(i)
	if flag == 0:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	brr = list(map(int, input().split()))
	draft = []
	for num in brr:
		if num not in draft:
			draft.append(num)
		else:
			print('YES')
			break
	else:
		print('NO')


def solve(array):
	my_set = set()
	for i in array:
		if i not in my_set:
			my_set.add(i)
		else:
			return True
	return False
t = int(input())
for test in range(t):
	n = int(input())
	array = list(map(int, input().strip().split()))
	ans = solve(array)
	if ans:
		print('YES')
	else:
		print('NO')


for j in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	if len(set(a)) == n:
		print('NO')
	else:
		print('yes')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split(' ')))
	x = len(set(l))
	if x < n:
		print('YES')
	else:
		print('NO')


x = int(input())
ans = [0 for i in range(x)]
for k in range(x):
	n = int(input())
	array_b = input().split()
	array_b.sort()
	for i in range(1, n):
		if array_b[i - 1] == array_b[i]:
			ans[k] = 1
			break
for k in range(x):
	print('YES') if ans[k] == 1 else print('NO')


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz/'
M = 1000000007
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	n = Int()
	a = array()
	if len(set(a)) == n:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	b = []
	c = 0
	for i in list(map(int, input().split())):
		if i in b:
			c += 1
		else:
			b.append(i)
	print('YNEOS'[c == 0::2])


for I in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = set(a)
	if len(b) != n:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().strip().split()))
	count = dict()
	flag = False
	for i in range(n):
		if arr[i] in count:
			flag = True
			break
		count[arr[i]] = 1
	if flag:
		print('YES')
	else:
		print('NO')


from math import *
from bisect import *
from collections import *
from random import *
from decimal import *
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def st():
	return input().rstrip('\n')

def lis():
	return list(map(int, input().split()))

def ma():
	return list(map(int, input().split()))
t = inp()
while t:
	t -= 1
	n = inp()
	a = lis()
	b = set(a)
	if len(b) == n:
		print('NO')
	else:
		print('YES')


import os
import sys
from io import BytesIO, IOBase
import math
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def f(n):
	val = pow(2, n)
	return val
for _ in range(int(input()) if True else 1):
	n = int(input())
	l = list(map(int, input().split()))
	if len(list(set(l))) == n:
		print('NO')
	else:
		print('YES')


from collections import Counter as C, defaultdict as D, deque as Q
from operator import itemgetter as I
from itertools import product as P
from bisect import bisect_left as BL, bisect_right as BR, insort as INSORT
from heapq import heappush as HPUSH, heappop as HPOP
from math import floor as MF, ceil as MC, gcd as MG, factorial as F, sqrt as SQRT, inf as INFINITY, log as LOG
from sys import stdin, stdout
INPUT = stdin.readline
PRINT = stdout.write
L = list
M = map

def player1():
	print('')

def player2():
	print('')

def isPrime(n):
	for i in range(2, MC(SQRT(n)) + 1):
		if n % i == 0:
			return False
	return True

def factors(x):
	ans = []
	for i in range(1, MC(SQRT(x)) + 1):
		if x % i == 0:
			ans.append(i)
			if x % (x // i) == 0:
				ans.append(x // i)
	return ans

def checkPath(source, destination, g):
	visited = [0] * 101
	q = Q()
	q.append(source)
	visited[source] = 1
	while q:
		node = q.popleft()
		if node == destination:
			return 1
		for v in g[node]:
			if not visited[v]:
				q.append(v)
				visited[v] = 1
	return 0

def makeSegments(s, n):
	seg = []
	(i, j) = (0, 0)
	while i < n and j < n:
		if s[i] == s[j]:
			j += 1
		else:
			seg.append((i, j - 1))
			i = j
	seg.append((i, j - 1))
	return seg

def main():
	for _ in range(int(INPUT())):
		n = int(INPUT())
		b = C(M(int, INPUT().split()))
		for v in b:
			if b[v] > 1:
				break
		else:
			PRINT('NO\n')
			continue
		PRINT('YES\n')
main()


import sys
input = sys.stdin.readline
from collections import Counter
for _ in range(int(input())):
	n = int(input())
	if max(Counter(map(int, input().split())).values()) > 1:
		print('YES')
	else:
		print('NO')


for _ in ' ' * int(input()):
	a = int(input())
	if a == len(set(map(int, input().split()))):
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	x = set(a)
	y = len(x)
	if y == n:
		print('NO')
	else:
		print('YES')


def solution(totalArr, size):
	newArr = set()
	checkSize = set(totalArr)
	if len(checkSize) != size:
		return 'YES'
	if size == 2:
		if totalArr[0] == totalArr[1]:
			return 'YES'
		else:
			return 'NO'
	return 'NO'
t = int(input())
for i in range(t):
	size = int(input())
	totalArr = list(map(int, input().split()))
	print(solution(totalArr, size))


def ass(a, b):
	if a != b:
		print(f'Assertion error: {a} != {b}')
	else:
		print('OK')

def number():
	return int(input())

def numbers():
	return [int(item) for item in input().split()]

def word():
	return input()

def words():
	return [item for item in input().split()]

def dump(lst):
	for (i, item) in enumerate(lst):
		print(i, item)

def binsearch(arr, a, b):
	m = (a + b) // 2
	if a >= b:
		return a - 1 if arr[a] == 0 else a
	return binsearch(arr, a, m - 1) if arr[m] == 0 else binsearch(arr, m + 1, b)

def f(arr):
	return 'NO' if len(set(arr)) == len(arr) else 'YES'
t = number()
for i in range(t):
	n = number()
	print(f(numbers()))


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	l = Counter(li)
	flag = False
	for i in l.values():
		if i != 1:
			print('YES')
			flag = True
			break
	if not flag:
		print('NO')


import sys
import math
from collections import defaultdict, Counter
input = sys.stdin.readline

def print(x):
	sys.stdout.write(str(x) + '\n')
t = int(input())
for i in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	s = set()
	for i in b:
		if i in s:
			print('YES')
			break
		s.add(i)
	else:
		print('NO')


for _ in range(int(input())):
	n = input()
	m = list(map(int, input().split()))
	print(['YES', 'NO'][len(set(m)) == len(m)])


t = int(input())
for i in range(t):
	s = set()
	n = int(input())
	a = list(map(int, input().split()))
	for j in range(len(a)):
		s.add(a[j])
	if len(s) == len(a):
		print('NO')
	else:
		print('YES')


from sys import *
input = lambda : stdin.readline()
int_arr = lambda : list(map(int, stdin.readline().strip().split()))
str_arr = lambda : list(map(str, stdin.readline().split()))
get_str = lambda : map(str, stdin.readline().strip().split())
get_int = lambda : map(int, stdin.readline().strip().split())
get_float = lambda : map(float, stdin.readline().strip().split())
mod = 1000000007
setrecursionlimit(1000)
for _ in range(int(input())):
	n = int(input())
	arr = int_arr()
	if len(set(arr)) == len(arr):
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	b = [int(i) for i in input().split()]
	good = False
	occurs = set()
	for x in b:
		if x in occurs:
			good = True
			break
		occurs.add(x)
	if good:
		print('YES')
	else:
		print('NO')


import math
i = int
s = set
t = int(input())
l = len
for _ in range(t):
	n = int(input())
	b = [i(j) for j in input().split()]
	if l(s(b)) == l(b):
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	if len(set(arr)) == len(arr):
		print('NO')
	else:
		print('YES')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	s = set(map(int, input().split()))
	if len(s) < n:
		print('YES')
	else:
		print('NO')


import sys, os
from math import sqrt, gcd, ceil, log, floor
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
input = sys.stdin.readline
read = lambda : list(map(int, input().strip().split()))
MOD = 10 ** 9 + 7

def main():
	for _ in range(int(input())):
		n = int(input())
		arr = read()
		if len(set(arr)) == n:
			print('NO')
		else:
			print('YES')
main()


import sys
import math
from collections import Counter
from collections import OrderedDict
from collections import defaultdict
from functools import reduce
sys.setrecursionlimit(10 ** 6)

def inputt():
	return sys.stdin.readline().strip()

def printt(n):
	sys.stdout.write(str(n) + '\n')

def listt():
	return [int(i) for i in inputt().split()]

def gcd(a, b):
	return math.gcd(a, b)

def lcm(a, b):
	return a * b // gcd(a, b)

def factors(n):
	step = 2 if n % 2 else 1
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(math.sqrt(n)) + 1, step) if n % i == 0)))

def comb(n, k):
	factn = math.factorial(n)
	factk = math.factorial(k)
	fact = math.factorial(n - k)
	ans = factn // (factk * fact)
	return ans

def is_prime(n):
	if n <= 1:
		return False
	if n == 2:
		return True
	if n > 2 and n % 2 == 0:
		return False
	max_div = math.floor(math.sqrt(n))
	for i in range(3, 1 + max_div, 2):
		if n % i == 0:
			return False
	return True

def maxpower(n, x):
	B_max = int(math.log(n, x)) + 1
	return B_max
t = int(input())
for _ in range(t):
	n = int(inputt())
	l = listt()
	d = Counter(l)
	g = False
	for (key, values) in d.items():
		if values > 1:
			print('YES')
			g = True
			break
	if g == False:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	q = list((int(x) for x in input().split()))
	e = set(q)
	if len(e) != n:
		print('yes')
	else:
		print('no')


for i in range(int(input())):
	input()
	s = input().split(' ')
	while 1:
		x = s.pop()
		if x in s:
			print('YES')
			break
		if len(s) == 0:
			print('NO')
			break


for i in range(int(input())):
	print('YNEOS'[int(input()) == len(set(input().split()))::2])


def check(arr):
	return len(arr) == len(set(arr))
t = int(input())
for i in range(t):
	input()
	arr = input().split()
	wrong = check(arr)
	if not wrong:
		print('YES')
	else:
		print('NO')


TC = int(input())
for tc in range(TC):
	N = int(input())
	mp = {}
	result = True
	for v in map(int, input().split()):
		if v in mp:
			result = False
			break
		mp[v] = True
	if result:
		print('NO')
	else:
		print('YES')


from sys import stdin, stdout
from collections import Counter
from itertools import permutations
import bisect
import math
I = lambda : map(int, stdin.readline().split())
I1 = lambda : stdin.readline()

def solve():
	n = int(I1())
	a = list(I())
	l = list(Counter(a).values())
	if max(l) >= 2:
		print('YES')
	else:
		print('NO')
for _ in range(int(I1())):
	solve()


for _ in range(int(input())):
	n = int(input())
	arr = [int(x) for x in input().split()]
	v = set()
	ans = True
	for i in arr:
		if i in v:
			ans = False
			break
		v.add(i)
	if ans:
		print('NO')
	else:
		print('YES')


testcase = int(input())
for i in range(testcase):
	N = int(input())
	Ns = list(map(int, input().split()))
	if len(set(Ns)) == N:
		print('NO')
	else:
		print('YES')


from collections import Counter
s = int(input())
for iii in range(0, s):
	a = int(input())
	n = list(map(int, input().split()))
	a = Counter(n).values()
	a = list(a)
	a.sort()
	maximum = a[len(a) - 1]
	if maximum >= 2:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout

def INI():
	return int(stdin.readline())

def INL():
	return [int(_) for _ in stdin.readline().split()]

def INS():
	return stdin.readline()

def MOD():
	return pow(10, 9) + 7

def OPS(ans):
	stdout.write(str(ans) + '\n')

def OPL(ans):
	[stdout.write(str(_) + ' ') for _ in ans]
	stdout.write('\n')
for _ in range(INI()):
	n = INI()
	X = INL()
	if len(set(X)) == n:
		OPS('NO')
	else:
		OPS('YES')


t = int(input())
for i in range(t):
	n = int(input())
	mas = list(map(int, input().split()))
	d = dict()
	j1 = 0
	j2 = 0
	for i in range(n):
		if mas[i] in d:
			j1 = d[mas[i]]
			j2 = i
		else:
			d[mas[i]] = i
	if j1 + j2 == 0:
		print('NO')
	else:
		print('YES')


import collections
t = int(input())
while t > 0:
	n = int(input())
	a = list(map(int, input().split()))
	seen = collections.Counter()
	ans = 0
	for i in a:
		if seen[i] == 0:
			seen[i] += 1
			ans += 1
	if ans == n:
		print('NO')
	else:
		print('YES')
	t -= 1


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	l = list(map(int, input().split()))
	s = set(l)
	if len(s) == n:
		print('NO')
	else:
		print('YES')


from collections import Counter
for i in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	s = set()
	for x in a:
		if not x in s:
			s.add(x)
		else:
			print('Yes')
			n = -1
			break
	if n == -1:
		continue
	print('No')


import sys
import math
from collections import Counter
lines = [list(map(int, line.split())) for line in sys.stdin.readlines()]
lines.pop(0)
while lines:
	l = Counter(lines[1])
	x = l.most_common(1)
	if x[0][1] != 1:
		print('YES')
	else:
		print('NO')
	lines = lines[2:]


for _ in range(int(input())):
	n = int(input())
	a = map(int, input().split())
	print('YNEOS'[len(set(a)) == n::2])


t = int(input())
for i in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	print(['NO', 'YES'][len(b) > len(set(b))])


from math import *
from sys import *
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	f = 0
	d = {}
	for i in range(n):
		if a[i] not in d:
			d[a[i]] = 0
		else:
			f = 1
			break
	if f == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	n = int(input())
	b = list(map(int, input().split()))
	d = {}
	for x in b:
		if x not in d:
			d[x] = 0
		d[x] += 1
	flag = False
	for k in d.keys():
		if d[k] > 1:
			flag = True
			break
	if flag:
		print('YES')
	else:
		print('NO')
	t -= 1


T = int(input())
from collections import Counter
for _ in range(T):
	N = int(input())
	B = list(map(int, input().split()))
	c = Counter(B)
	print('YES' if c.most_common(1)[0][1] > 1 else 'NO')


import sys

def get_ints():
	return list(map(int, sys.stdin.readline().strip().split()))
t = int(input())
for _ in range(t):
	n = int(input())
	b = get_ints()
	ct = {}
	f = 0
	for i in range(n):
		ct[b[i]] = ct.get(b[i], 0) + 1
		if ct[b[i]] > 1:
			f = 1
			break
	if f:
		print('YES')
	else:
		print('NO')


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for asdf in range(t):
	n = inp()
	a = inlt()
	b = sorted(a)
	tmp = -1
	chk = False
	for i in b:
		if i == tmp:
			chk = True
			break
		tmp = i
	if chk:
		print('YES')
	else:
		print('NO')


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	d = dict(Counter(b))
	if max(d.values()) > 1:
		print('YES')
	else:
		print('NO')


def sort(lst):
	for i in range(len(lst)):
		a = lst[i]
		for j in range(i + 1, len(lst)):
			if lst[j] < a:
				a = lst[j]
				(lst[i], lst[j]) = (lst[j], lst[i])
	return lst
import sys
t = int(sys.stdin.readline())
for j in range(t):
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	sorted_a = sorted(a)
	kt = False
	for i in range(len(sorted_a) - 1):
		if sorted_a[i] == sorted_a[i + 1]:
			print('YES')
			kt = True
			break
	if kt == False:
		print('NO')


def solve():
	n = int(input())
	a = list(map(int, input().split()))
	st = set(a)
	if len(st) != len(a):
		print('YES')
	else:
		print('NO')
_ = int(input())
while _ > 0:
	solve()
	_ -= 1


t = int(input())
cantidades = []
listas = []
for i in range(t):
	cantidades.append(int(input()))
	listas.append(input().split())
listas_enteras = []
for i in range(len(listas)):
	mapeo_entero = map(int, listas[i])
	lista_entera = list(mapeo_entero)
	listas_enteras.append(lista_entera)
for i in range(t):
	if not len(listas_enteras[i]) == len(set(listas_enteras[i])):
		print('YES')
	else:
		print('NO')


from sys import *
from collections import defaultdict as dd
from math import *
from bisect import *

def sinp():
	return input()

def inp():
	return int(sinp())

def minp():
	return map(int, sinp().split())

def linp():
	return list(minp())

def strl():
	return list(sinp())

def pr(x):
	print(x)
mod = int(1000000000.0 + 7)
for _ in range(inp()):
	n = inp()
	b = linp()
	d = dd(int)
	for i in b:
		d[i] += 1
	pr('YES' if len(d) != n else 'NO')


import sys
l = sys.stdin.readlines()
i = 0
t = int(l[i].replace('\n', ''))
i = 1
while True:
	n = int(l[i].replace('\n', ''))
	i += 1
	b = [int(x) for x in l[i].replace('\n', '').split()]
	i += 1
	b.sort()
	aux = 1
	for j in range(1, len(b)):
		aux = b[j] - b[j - 1]
		if aux == 0:
			print('YES')
			break
	if aux != 0:
		print('NO')
	if i == len(l):
		break


for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	hasSeen = set()
	for i in range(n):
		if b[i] in hasSeen:
			print('YES')
			break
		hasSeen.add(b[i])
	else:
		print('NO')


import sys, os.path
from collections import *
from heapq import *
from copy import *
import math
mod = 10 ** 9 + 7
read = lambda : map(int, input().split())
inf = float('inf')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
for t in range(int(input())):
	n = int(input())
	b = list(read())
	d = Counter(b)
	flag = 0
	for i in d:
		if d[i] >= 2:
			flag = 1
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')


tc = int(input())
for t in range(tc):
	n = int(input())
	flag = 0
	d = dict()
	arr = input().split()
	for i in range(len(arr)):
		arr[i] = int(arr[i])
	for i in range(len(arr)):
		if d.get(arr[i], 0) != 0:
			flag = 1
		else:
			d[arr[i]] = 1
	if flag == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	p = list(map(int, input().split()))
	if len(set(p)) < len(p):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	a = [int(j) for j in input().split()]
	if len(a) != len(set(a)):
		print('yes')
	else:
		print('no')


test_cases = range(int(input()))
for test_case in test_cases:
	n = int(input())
	b = list(map(int, input().split()))
	if len(set(b)) < len(b):
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	b = [int(i) for i in input().split() if i != '\n']
	if len(b) == len(set(b)):
		print('NO')
	else:
		print('YES')


from collections import Counter
tc = int(input())
while tc:
	n = input()
	b = list(map(int, input().split()))
	flag = True
	a = Counter(b)
	for (i, j) in a.items():
		if j >= 2:
			flag = False
			print('YES')
			break
	if flag:
		print('NO')
	tc -= 1


T = int(input())
for x in range(T):
	n = int(input())
	a = [int(y) for y in input().split()]
	a.sort()
	for z in range(1, n):
		if a[z] == a[z - 1]:
			ans = 1
			break
		else:
			ans = -1
	if ans == 1:
		print('YES')
	else:
		print('NO')


n = int(input())
r = [0] * n
for i in range(n):
	size = int(input())
	expoentes = list(map(int, input().split()))
	dic = {}
	for j in range(size):
		if expoentes[j] not in dic:
			dic[expoentes[j]] = 1
		else:
			r[i] = True
			break
for c in r:
	if c:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	d = {}
	for i in arr:
		if i not in d:
			d[i] = 1
		else:
			d[i] += 1
	f = 0
	for i in d:
		if d[i] > 1:
			f = 1
	if f == 0:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	N = int(input())
	A = [int(i) for i in input().split()]
	dict = {}
	for i in range(N):
		if A[i] in dict:
			dict[A[i]] += 1
		else:
			dict[A[i]] = 1
	yes = False
	for i in dict:
		if dict[i] >= 2:
			yes = True
			break
	if yes:
		print('YES')
	else:
		print('NO')