Abhi is a salesman. He was given two types of candies, which he is selling in N different cities.

For the prices of the candies to be valid, Abhi's boss laid down the following condition:
A given type of candy must have distinct prices in all N cities.

In his excitement, Abhi wrote down the prices of both the candies on the same page and in random order instead of writing them on different pages. Now he is asking for your help to find out if the prices he wrote are valid or not.

More formally, you are given an array A of size 2N. Find out whether it is possible to split A into two arrays, each of length N, such that both arrays consist of distinct elements.

------ Input Format ------ 

- The first line of input will contain a single integer T, denoting the number of test cases.
- Each test case consists of two lines of input.
- The first line of each test case contains one integer N, denoting the number of cities
- The second line contains 2N space-separated integers A_{1}, A_{2}, \ldots, A_{2N} — the elements of the array A.

------ Output Format ------ 

For each test case output the answer on a new line — Yes if the given array represents a valid list of prices, and No otherwise.

Each letter of the output may be printed in either uppercase or lowercase, i.e, Yes, YES, and yEs will all be treated as equivalent.

------ Constraints ------ 

$1 ≤ T ≤ 10^{3}$
$1 ≤ N ≤ 10^{3}$
$1 ≤ A_{i} ≤ 10^{9}$
- The sum of $N$ over all testcases does not exceed $2\cdot 10^{3}$

----- Sample Input 1 ------ 
4
3
4 8 4 6 7 3
3
4 8 6 8 7 8
2
2 4 5 3
4
8 7 9 8 4 6 2 8

----- Sample Output 1 ------ 
Yes
No
Yes
No
----- explanation 1 ------ 
Test case $1$: One valid way of assigning prices is as follows:
- The first candy can have a price of $4$ in city $1$, $6$ in city $2$, and $8$ in city $3$.
- The second candy can have a price of $4$ in city $1$, $3$ in city $2$, and $7$ in city $3$.

Since a valid assignment exists, the answer is "Yes".

Test case $2$: No valid set of prices exists that could give this array, since $8$ would be repeated somewhere.

Test case $3$: One way of splitting the prices is $[2, 5]$ and $[4, 3]$.

Test case $4$: No valid set of prices exists that could give this array.

Source: codechef | Difficulty: EASY


Solutions:
for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	for j in l:
		if l.count(j) >= 3:
			print('No')
			break
	else:
		print('Yes')


for i in range(int(input())):
	cities = int(input())
	vals = input().split(' ')
	g = False
	for i in vals:
		if vals.count(i) >= 3:
			g = True
	if g == True:
		print('No')
	else:
		print('Yes')


t = int(input())
for i in range(t):
	n = int(input())
	li = list(map(int, input().split()))
	for i in li:
		if li.count(i) > 2:
			print('No')
			break
	else:
		print('Yes')


T = int(input())
for _ in range(T):
	N = int(input())
	A = list(map(int, input().split()))
	flag = 0
	for i in set(A):
		if A.count(i) > 2:
			flag = 1
			break
	if flag:
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	n = int(input())
	l = [int(x) for x in input().split()]
	c = list(map(lambda x: l.count(x), l))
	if max(c) > 2:
		print('No')
	else:
		print('Yes')


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	c = 1
	for j in a:
		if a.count(j) > 2:
			print('No')
			c = 0
			break
	if c == 1:
		print('Yes')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	flag = 1
	for i in a:
		if a.count(i) > 2:
			print('No')
			flag = 0
			break
	if flag == 1:
		print('Yes')


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	flag = 0
	for i in a:
		if a.count(i) >= 3:
			flag += 1
	if flag > 1:
		print('No')
	else:
		print('Yes')


a = int(input())
for i in range(1, a + 1):
	b = int(input())
	c = list(map(int, input().split()))
	for i in c:
		if c.count(i) >= 3:
			print('No')
			break
	else:
		print('Yes')


s = int(input())
for i in range(s):
	a = int(input())
	l = list(map(int, input().split()))
	c = {}
	for j in l:
		if j in c:
			c[j] += 1
		elif j not in c:
			c[j] = 1
	for m in c:
		if c[m] > 2:
			print('No')
			break
	else:
		print('Yes')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	price_set = set(a)
	answer = 'Yes'
	for i in price_set:
		count = a.count(i)
		if count >= 3:
			answer = 'No'
	print(answer)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	d2 = {}
	for j in a:
		if j not in d2:
			d2[j] = 1
		else:
			d2[j] += 1
			if d2[j] == 3:
				print('No')
				break
	else:
		print('Yes')


for _ in range(int(input())):
	N = int(input())
	city_array = list(map(int, input().split(' ')))
	for i in city_array:
		if city_array.count(i) > 2:
			print('No')
			break
	else:
		print('Yes')


def candies(a):
	h1 = []
	h2 = []
	for i in a:
		if i not in h1:
			h1.append(i)
		elif i not in h2:
			h2.append(i)
		else:
			return 'No'
	return 'Yes'
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	print(candies(a))


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	print('Yes' if max(Counter(a).values()) <= 2 else 'No')


T = int(input())
for n in range(T):
	N = int(input())
	num = input()
	asdf = num.split()
	L = list(map(int, asdf))
	yesno = True
	for n in L:
		if L.count(n) >= 3:
			yesno = False
	if yesno == False:
		print('No')
	elif yesno == True:
		print('Yes')


for i in range(int(input())):
	N = int(input())
	A = []
	A.append(input().split())
	for j in A:
		for k in j:
			if j.count(k) >= 3:
				b = 0
				break
			else:
				b = 1
	if b == 1:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	n = int(input())
	m = list(map(int, input().split()))
	z = 0
	for i in m:
		x = m.count(i)
		if x > 2:
			z = z + 1
	if z >= 1:
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	N = int(input())
	A = list(map(int, input().split()))
	B = 0
	for i in A:
		C = A.count(i)
		if C >= 3:
			B += 1
	if B > 1:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	d = {}
	f = 0
	for i in l:
		if i not in d:
			d[i] = 1
		else:
			d[i] = d[i] + 1
			if d[i] > 2:
				f = 1
				print('No')
				break
	if f == 0:
		print('Yes')


t = int(input())
for i in range(0, t):
	n = int(input())
	lists = list(map(int, input().split()))
	nlists = []
	ans = None
	for a in lists:
		dup = 0
		for b in lists:
			if a == b:
				dup += 1
		nlists.append(dup)
	for k in nlists:
		if k > 2:
			ans = True
	if ans:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	cnt = 0
	for j in lst:
		x = lst.count(j)
		if x >= 3:
			cnt += 1
	if cnt >= 1:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	n = int(input())
	x = list(map(int, input().split()))
	counter = 0
	for i in x:
		curfreq = x.count(i)
		if curfreq > counter:
			counter = curfreq
		else:
			pass
	if counter >= 3:
		print('No')
	else:
		print('Yes')


goals = int(input())
for i in range(goals):
	aim = int(input())
	life = list(map(int, input().split()))
	wife = {}
	for death in life:
		if death not in wife:
			wife[death] = 1
		else:
			wife[death] += 1
	for j in wife:
		if wife[j] <= 2:
			continue
		else:
			print('No')
			break
	else:
		print('Yes')


for i in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	flag = False
	for i in lst:
		if lst.count(i) > 2:
			flag = True
			break
	print('Yes' if flag == False else 'No')


for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	s = set(a)
	o = 'Yes'
	for i in s:
		cn = 0
		for j in a:
			if i == j:
				cn += 1
		if cn > 2:
			o = 'No'
			break
	print(o)


candies = int(input())
for i in range(candies):
	goal = int(input())
	rule = list(map(int, input().split()))
	knife = {}
	for death in rule:
		if death not in knife:
			knife[death] = 1
		else:
			knife[death] += 1
	for j in knife:
		if knife[j] <= 2:
			continue
		else:
			print('No')
			break
	else:
		print('Yes')


t = int(input())
for i in range(t):
	n = int(input())
	flag = 0
	l = list(map(int, input().split()))
	for element in l:
		if l.count(element) > 2:
			flag = 1
	if flag:
		print('No')
	else:
		print('Yes')


t = int(input())
for _ in range(t):
	n = int(input())
	lis = list(map(int, input().split()))
	flag = True
	for x in lis:
		if lis.count(x) > 2:
			flag = False
	if flag:
		print('Yes')
	else:
		print('No')


T = int(input())
for i in range(T):
	n = int(input())
	l = list(map(int, input().split()))
	count = 0
	c = 0
	for j in l:
		k = l.count(j)
		if k >= 3:
			c += 1
	if c > 1:
		print('No')
	else:
		print('Yes')


from collections import Counter
T = int(input())
for _ in range(T):
	N = int(input())
	A = list(map(int, input().split(' ')))
	counts = Counter(A)
	ans = 'Yes'
	for num in counts:
		if counts[num] > 2:
			ans = 'No'
			break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	f = 'Yes'
	l = list(map(int, input().split()))
	for i in set(l):
		if l.count(i) > 2:
			f = 'No'
			break
	print(f)


from collections import Counter
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	c = Counter(a)
	b = sorted(c.values())
	if b[-1] >= 3:
		print('No')
	else:
		print('Yes')


T = int(input())
for _ in range(T):
	a = []
	b = []
	N = int(input())
	A = list(map(int, input().split(' ')))
	for i in range(len(A)):
		if A[i] not in a:
			a.append(A[i])
		else:
			b.append(A[i])
	c = []
	for i in range(len(b)):
		if b[i] not in c:
			c.append(b[i])
		else:
			print('No')
			break
	else:
		print('Yes')


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	d = {}
	for i in a:
		keys = d.keys()
		if i in keys:
			d[i] += 1
		else:
			d[i] = 1
	c = 0
	for k in d.values():
		if k > 2:
			print('No')
			break
	else:
		print('Yes')


n = int(input())
for i in range(n):
	x = int(input())
	l = list(map(int, input().split()))
	for i in l:
		if l.count(i) > 2:
			print('No')
			break
	else:
		print('Yes')


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))[:2 * n]
	print('Yes' if max((arr.count(x) for x in arr)) <= 2 else 'No')


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	k = 0
	for j in l:
		if l.count(j) > 2:
			k = 1
			print('No')
			break
	if k == 0:
		print('Yes')