Long time ago there was a symmetric array $a_1,a_2,\ldots,a_{2n}$ consisting of $2n$ distinct integers. Array $a_1,a_2,\ldots,a_{2n}$ is called symmetric if for each integer $1 \le i \le 2n$, there exists an integer $1 \le j \le 2n$ such that $a_i = -a_j$.

For each integer $1 \le i \le 2n$, Nezzar wrote down an integer $d_i$ equal to the sum of absolute differences from $a_i$ to all integers in $a$, i. e. $d_i = \sum_{j = 1}^{2n} {|a_i - a_j|}$.

Now a million years has passed and Nezzar can barely remember the array $d$ and totally forget $a$. Nezzar wonders if there exists any symmetric array $a$ consisting of $2n$ distinct integers that generates the array $d$.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 10^5$) — the number of test cases.

The first line of each test case contains a single integer $n$ ($1 \le n \le 10^5$).

The second line of each test case contains $2n$ integers $d_1, d_2, \ldots, d_{2n}$ ($0 \le d_i \le 10^{12}$).

It is guaranteed that the sum of $n$ over all test cases does not exceed $10^5$.


-----Output-----

For each test case, print "YES" in a single line if there exists a possible array $a$. Otherwise, print "NO".

You can print letters in any case (upper or lower).


-----Examples-----

Input
6
2
8 12 8 12
2
7 7 9 11
2
7 11 7 11
1
1 1
4
40 56 48 40 80 56 80 48
6
240 154 210 162 174 154 186 240 174 186 162 210
Output
YES
NO
NO
NO
NO
YES


-----Note-----

In the first test case, $a=[1,-3,-1,3]$ is one possible symmetric array that generates the array $d=[8,12,8,12]$.

In the second test case, it can be shown that there is no symmetric array consisting of distinct integers that can generate array $d$.

Difficulty: MEDIUM_HARD
Tags: Mathematics

Sorting

Implementation
Skill types: Sorting

Starter code:

Solutions:
for _ in range(int(input())):
	n = int(input())
	d = list(map(int, input().split(' ')))
	a = [0] * n
	uniq_a = set()
	is_exist = True
	sd = sorted(d, reverse=True)
	part_sum = 0
	for i in range(n):
		if sd[2 * i] != sd[2 * i + 1]:
			is_exist = False
			break
		a[i] = sd[2 * i] - part_sum
		if a[i] <= 0 or a[i] % (2 * (n - i)) != 0:
			is_exist = False
			break
		a[i] //= int(2 * (n - i))
		if a[i] in uniq_a:
			is_exist = False
			break
		uniq_a.add(a[i])
		part_sum += 2 * a[i]
	print(['NO', 'YES'][is_exist])


import sys, io, os
if os.environ['USERNAME'] == 'kissz':
	inp = open('in.txt', 'r').readline

	def debug(*args):
		print(*args, file=sys.stderr)
else:
	inp = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

	def debug(*args):
		pass
for _ in range(int(inp())):
	n = int(inp())
	A = [*map(int, inp().split())]
	A.sort(reverse=True)
	X = []
	xsum = 0
	ans = 'YES'
	for i in range(n):
		if A[2 * i] != A[2 * i + 1]:
			ans = 'NO'
			break
		debug(X, xsum, A[2 * i] - 2 * xsum, 2 * (n - i))
		if (A[2 * i] - 2 * xsum) % (2 * (n - i)) == 0 and A[2 * i] - 2 * xsum > 0:
			x = (A[2 * i] - 2 * xsum) // (2 * (n - i))
			if X and x == X[-1]:
				ans = 'NO'
				break
			X.append(x)
			xsum += x
			debug(X, xsum, A[2 * i])
		else:
			ans = 'NO'
			break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))

	def chk(li, n):
		li.sort(reverse=True)
		i = 0
		while i < 2 * n - 1:
			if li[i] % 2 != 0:
				return 'NO'
			if li[i] == li[i + 1] and (i == 2 * n - 2 or li[i] != li[i + 2]):
				pass
			else:
				return 'NO'
			i += 2
		fin = []
		te = 0
		p = 2 * n
		for k in range(0, 2 * n - 1, 2):
			if (li[k] - te) % p == 0 and li[k] - te > 0:
				ad = int((li[k] - te) / p)
				fin.append(ad)
				p -= 2
				te += 2 * ad
			else:
				return 'NO'
		return 'YES'
	print(chk(li, n))


import sys
input = sys.stdin.readline
from collections import Counter
for _ in range(int(input())):
	n = int(input())
	A = sorted(map(int, input().split()))
	for k in A:
		if k % 2:
			print('NO')
			break
	else:
		A = [k // 2 for k in A]
		cnt = Counter(A)
		keys = sorted(cnt.keys())
		m = len(keys)
		if m == 1:
			k = keys[0]
			if cnt[k] not in [2, 1]:
				print('NO')
			else:
				print('YES')
			continue
		for i in keys:
			if not i:
				if cnt[i] not in [2, 1]:
					print('NO')
					break
			elif cnt[i] != 2:
				print('NO')
				break
		else:
			pre = 0
			for i in range(m - 1, -1, -1):
				cur = keys[i] - pre
				if cur <= 0:
					print('NO')
					break
				(k, r) = divmod(cur, i + 1)
				if r:
					print('NO')
					break
				pre += k
			else:
				print('YES')


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	d_ls = list(map(int, sys.stdin.readline().split()))
	ans = 'YES'
	check = {}
	for i in d_ls:
		try:
			check[i] += 1
		except:
			check[i] = 1
	for k in check.values():
		if k != 2:
			ans = 'NO'
	if ans != 'NO':
		d_ls = list(set(d_ls))
		d_ls.sort()
		dif = []
		x = 2 * n - 2
		for i in range(len(d_ls) - 1, 0, -1):
			if (d_ls[i] - d_ls[i - 1]) % x != 0:
				ans = 'NO'
				break
			else:
				dif.append((d_ls[i] - d_ls[i - 1]) // x)
				x -= 2
		if d_ls[-1] % (2 * n) != 0 or d_ls[-1] // (2 * n) <= sum(dif):
			ans = 'NO'
	print(ans)


from sys import stdin
input = stdin.readline

def sym(arr, n):
	if len(arr) == 2 and arr[1] != arr[0]:
		return 'NO'
	temp = 0
	lt = 0
	n = 2 * n
	a = list(set(arr))
	a = sorted(a, reverse=True)
	for val in a:
		if (val - 2 * temp) % n != 0 or val - temp == 0:
			return 'NO'
		if (val - 2 * temp) // n <= 0:
			return 'NO'
		temp += (val - 2 * temp) // n
		lt += 1
		n -= 2
	if lt == len(arr) // 2:
		return 'YES'
	return 'NO'
for i in range(int(input())):
	n = int(input())
	lst = list(map(int, input().strip().split()))
	print(sym(lst, n))


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	v = Counter(l).values()
	f = 1
	for i in v:
		if i != 2:
			f = 0
			break
	for i in l:
		if i % 2:
			f = 0
			break
	if 0 in l:
		f = 0
	if f:
		ls = list(set(l))
		ls.sort(reverse=True)
		(num, total) = ([], 0)
		for i in ls:
			if (i - total) % (2 * n) or i < total or (not i - total and i > 0):
				f = 0
				break
			else:
				x = (i - total) // (2 * n)
				total += 2 * x
				num.append(x)
				n -= 1
	if f:
		print('YES')
	else:
		print('NO')


t = int(input())
import math
while t > 0:
	t -= 1
	n = int(input())
	ar = [int(x) for x in input().split()]
	flag = True
	ar.sort()
	dr = []
	for i in range(n):
		if ar[2 * i] == ar[2 * i + 1]:
			dr.append(ar[2 * i])
		else:
			flag = False
	if flag:
		for i in range(n):
			if not dr[i] % 2 == 0:
				flag = False
	if flag:
		s = 0
		ans = [0 for i in range(n)]
		for i in reversed(range(n)):
			ans[i] = (dr[i] / 2 - s) / (i + 1)
			s += ans[i]
		for i in range(n):
			if not int(ans[i]) == ans[i]:
				flag = False
		if not len(set(ans)) == n:
			flag = False
		if not sorted(ans) == ans:
			flag = False
		ans.sort()
		if ans[0] <= 0:
			flag = False
	if flag:
		print('YES')
	else:
		print('NO')


import sys

def input():
	return sys.stdin.readline().strip()
t = int(input())
while t:
	t -= 1
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort(reverse=True)
	unq = []
	possible = True
	for i in range(0, 2 * n, 2):
		if a[i] % 2:
			possible = False
			break
		if a[i] != a[i + 1]:
			possible = False
			break
		unq.append(a[i] // 2)
	if not possible:
		print('NO')
		continue
	cur = 0
	ans = 10 ** 15
	for i in range(n):
		if (unq[i] - cur) % (n - i):
			possible = False
			break
		if unq[i] <= cur:
			possible = False
			break
		temp = (unq[i] - cur) // (n - i)
		if temp >= ans:
			possible = False
			break
		cur += temp
		ans = temp
	if possible:
		print('YES')
	else:
		print('NO')


def solve(arr, n):
	d = dict()
	for num in arr:
		if num % 2 == 0:
			if num in d:
				d[num] += 1
			else:
				d[num] = 1
		else:
			return 'NO'
	for (k, v) in d.items():
		if v != 2:
			return 'NO'
	brr = list(set(arr))
	brr.sort(reverse=True)
	count = 0
	for i in range(n):
		if (brr[i] // 2 - count) % (n - i) != 0 or brr[i] // 2 - count <= 0:
			return 'NO'
		else:
			count = count + (brr[i] // 2 - count) // (n - i)
	return 'YES'
t = int(input())
for z in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	s = solve(arr, n)
	print(s)


for w in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	arr = sorted(list(map(int, set(s))), reverse=True)
	i = t = 0
	test = 'YES'
	count = dict()
	if len(arr) != n:
		test = 'NO'
	for p in s:
		count[p] = count.get(p, 0) + 1
	for p in count:
		if count[p] != 2:
			test = 'NO'
	while test == 'YES' and i < n:
		arr[i] -= t * 2
		if arr[i] % ((n - i) * 2) == 0:
			x = arr[i] // ((n - i) * 2)
			if x <= 0:
				test = 'NO'
				break
			t += x
		else:
			test = 'NO'
			break
		i = i + 1
	print(test)


from collections import defaultdict
t = int(input())
while t != 0:
	n = int(input())
	list2 = list(map(int, input().split()))
	d1 = defaultdict(int)
	f = 0
	for i in range(len(list2)):
		if list2[i] % 2 == 1 or list2[i] < 0:
			f = 1
			break
		else:
			d1[list2[i]] += 1
	if f == 1:
		print('NO')
	else:
		list1 = []
		for i in d1.keys():
			if d1[i] % 2 == 1 or i % 2 == 1:
				f = 1
				break
			else:
				for j in range(d1[i] // 2):
					list1.append(i // 2)
		if f == 1:
			print('NO')
		else:
			list1.sort()
			temp_s = 0
			count = n
			d = defaultdict(int)
			f = 0
			for i in range(len(list1) - 1, -1, -1):
				p = (list1[i] - temp_s) // count
				if (list1[i] - temp_s) % count != 0 or p <= 0:
					f = 1
					break
				else:
					d[p] += 1
					if d[p] > 1:
						f = 1
						break
					temp_s += p
				count -= 1
			if f == 1:
				print('NO')
			else:
				print('YES')
	t -= 1


def check(array):
	for i in range(len(array) - 1):
		if i % 2:
			if array[i] == array[i + 1]:
				return False
		elif array[i] != array[i + 1]:
			return False
	return True

def solve(array, n):
	result = {}
	sum = 0
	for i in range(n - 1, -1, -1):
		ans = (array[i] / 2 - sum) / (i + 1)
		if ans != int(ans) or ans <= 0:
			return False
		if ans in result:
			return False
		result[ans] = True
		sum += ans
	return True
for _ in range(int(input())):
	n = int(input())
	array = list(map(int, input().split()))
	array.sort()
	if check(array):
		array = list(set(array))
		array.sort()
		if solve(array, n):
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


import sys
inp = lambda : sys.stdin.readline().strip()
intl = lambda : list(map(int, inp().split(' ')))
for _ in range(int(input())):
	n = int(input())
	d = intl()
	d.sort(reverse=True)
	flag = True
	for i in range(n):
		if d[2 * i] != d[2 * i + 1] or d[2 * i] % 2 != 0:
			flag = False
			break
	if d[0] % (2 * n) != 0:
		print('NO')
		continue
	sumo = d[0] // (2 * n)
	for i in range(n - 1):
		p = (d[2 * i] - d[2 * (i + 1)]) // 2
		sumo -= p // (n - 1 - i)
		if p % (n - 1 - i) != 0 or p <= 0 or sumo <= 0:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	arr = tuple(map(int, input().split()))
	d = {}
	for num in arr:
		d[num] = d.get(num, 0) + 1
	if any((d[i] != 2 for i in d)):
		print('NO')
		continue
	s = 0
	sarr = sorted(d.keys())
	for i in range(n - 1, -1, -1):
		(ratio, rem) = divmod(sarr[i] - s, 2 * (i + 1))
		if ratio < 1 or rem:
			print('NO')
			break
		s += 2 * ratio
	else:
		print('YES')


import math
for t in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	a = list(set(a))
	if len(a) != n:
		print('NO')
		continue
	a.sort()
	a = a[::-1]
	s = 0
	x = 0
	for i in a:
		if (i - s) % (2 * n) != 0:
			x = 1
			break
		y = (i - s) // n
		if y <= 0:
			x = 1
			break
		s += y
		n -= 1
	if x:
		print('NO')
	else:
		print('YES')


from collections import Counter
import sys
from io import BytesIO, IOBase
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')

def solve():
	n = int(input())
	d = [int(x) for x in input().split(' ')]
	C = Counter(d)
	x = []
	for (k, v) in C.items():
		if v != 2 or k <= 0 or k % 2 != 0:
			return False
		else:
			x.append(k)
	else:
		x.sort(reverse=True)
		if x[0] % (2 * n) != 0:
			return False
		else:
			a = [x[0] // (2 * n)]
			for i in range(1, n):
				if (x[i - 1] - x[i]) % (2 * (n - i)) != 0:
					return False
				else:
					a.append(a[-1] - (x[i - 1] - x[i]) // (2 * (n - i)))
	return a[-1] > 0
t = int(input())
for case in range(t):
	if solve():
		print('YES')
	else:
		print('NO')


import math

def solve():
	n = int(input())
	arr = list(map(int, input().split()))
	count = {}
	for i in arr:
		count[i] = count.get(i, 0) + 1
	for i in count:
		if count[i] != 2:
			return 'NO'
	sum = 0
	for i in sorted(set(arr), reverse=True):
		if i - sum > 0 and (i - sum) % (n * 2) == 0:
			sum += (i - sum) // n
		else:
			return 'NO'
		n -= 1
	return 'YES'
for _ in range(int(input())):
	print(solve())


import collections
t = int(input())
for _ in range(t):
	n = int(input())
	d = list(map(int, input().split()))
	d.sort()
	c = collections.Counter(d)
	for x in c:
		if c[x] != 2:
			print('NO')
			break
	else:
		d = sorted(set(d))
		if d[0] % 2:
			print('NO')
		else:
			s = d[0] // 2
			a = []
			for j in range(1, n):
				v = d[j] - d[j - 1]
				if v % (2 * j):
					print('NO')
					break
				a.append(v // (2 * j))
			else:
				(f, g) = (0, 0)
				for j in range(n - 1):
					f += a[j]
					g += f
				if g < s and (s - g) % n == 0:
					print('YES')
				else:
					print('NO')


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

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

def check(a):
	for x in a:
		if x % 2 == 1:
			return False
	for i in range(2, len(a), 2):
		if a[i] == a[i - 1]:
			return False
	return True
for ii in range(int(input())):
	n = int(input())
	a = arrIn()
	a.sort()
	div = n * 2
	s = 0
	if check(a) == False:
		print('NO')
		continue
	if n == 1:
		if a[0] == a[1] and a[0] % 2 == 0:
			print('YES')
		else:
			print('NO')
		continue
	flag = 'YES'
	for i in range(2 * n - 1, -1, -2):
		if s >= a[i]:
			flag = 'NO'
			break
		elif (a[i] - s) % div != 0:
			flag = 'NO'
			break
		x = (a[i] - s) // div
		s += x * 2
		div -= 2
	print(flag)


import sys
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	n = int(input())
	D = sorted(map(int, input().split()))[::-1]
	Ans = [None] * n
	flag = 1
	if D[0] % (2 * n) or D[0] != D[1]:
		flag = 0
	else:
		Ans[0] = D[0] // (2 * n)
		for i in range(1, n):
			if D[2 * i] != D[2 * i + 1]:
				flag = 0
				break
			if (D[2 * i - 1] - D[2 * i]) % (2 * (n - i)):
				flag = 0
				break
			Ans[i] = Ans[i - 1] - (D[2 * i - 1] - D[2 * i]) // (2 * (n - i))
			if Ans[i] <= 0 or Ans[i] == Ans[i - 1]:
				flag = 0
				break
	if flag and sum(Ans) * 2 == D[-1]:
		print('YES')
	else:
		print('NO')


import sys, os, io
from collections import defaultdict
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for _ in range(int(input())):
	n = int(input())
	n *= 2
	a = [int(i) for i in input().split()]
	a.sort(reverse=1)
	curr = 0
	flag = 0
	dic = defaultdict(lambda : 0)
	arr = []
	for i in a:
		dic[i] += 1
	for i in dic:
		if dic[i] != 2:
			flag = 1
			break
	if flag:
		print('NO')
		continue
	arr = []
	for i in range(0, n, 2):
		if a[i] % 2 == 1:
			flag = 1
			break
		if (a[i] - curr) % (n - i) == 0:
			x = round((a[i] - curr) // (n - i))
			curr += 2 * x
		else:
			flag = 1
			break
		if x <= 0:
			flag = 1
		arr.append(x)
		arr.append(-x)
	if flag:
		print('NO')
	elif len(arr) == len(set(arr)):
		print('YES')
	else:
		print('NO')


import sys
nTest = int(input())
for iTest in range(nTest):
	n = int(input())
	x = input()
	a = []
	d = {}
	for i in x.split():
		a.append(int(i))
		if int(i) not in d:
			d[int(i)] = 1
		else:
			d[int(i)] += 1
	f = 1
	for i in d:
		if d[i] != 2:
			f = 0
			break
	if not f:
		print('NO')
		continue
	a.sort()
	s = set()
	for x in a:
		s.add(x)
	if len(s) != n:
		print('NO')
		continue
	a.clear()
	for x in s:
		a.append(x)
	a.sort()
	a.reverse()
	sum = 0
	for i in range(n):
		if a[i] - 2 * sum <= 0 or (a[i] - 2 * sum) % (2 * (n - i)) != 0:
			f = 0
			break
		sum += (a[i] - 2 * sum) / (2 * (n - i))
	if f:
		print('YES')
	else:
		print('NO')


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

class FastIO(IOBase):

	def __init__(self, file):
		self.newlines = 0
		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()

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

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

def N():
	return int(input())

def S():
	return input().strip()

def print_list(l):
	print(' '.join(map(str, l)))
for _ in range(N()):
	n = N()
	a = RLL()
	a.sort()
	a1 = a[::2]
	a2 = a[1::2]
	if a1 != a2 or len(set(a1)) < n or any((v & 1 for v in a1)):
		print('NO')
		continue
	a = a1
	dx = [0]
	f = True
	for i in range(1, n):
		t = a[i] - a[i - 1]
		if t % (2 * i):
			f = False
			break
		dx.append(t // (2 * i))
	if not f:
		print('NO')
		continue
	for i in range(1, len(dx)):
		dx[i] += dx[i - 1]
	k = a[0] - sum(dx) * 2
	print('YES' if k > 0 and k % (2 * n) == 0 else 'NO')


from sys import stdin
stdin.readline

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

def it():
	return int(stdin.readline().strip())
from collections import Counter as C
for _ in range(it()):
	n = it()
	l = mp()
	c = C(l)
	flag = 0
	v = []
	for i in c:
		if c[i] != 2:
			flag = 1
		else:
			v.append(i)
	if flag:
		print('NO')
	else:
		v.sort()
		c = 0
		p = [0] * n
		for i in range(n - 1, -1, -1):
			v[i] -= c
			if v[i] > 0 and v[i] % (2 * (i + 1)) == 0:
				p[i] = v[i] // (2 * (i + 1))
				c += 2 * p[i]
			else:
				flag = 1
				break
		if flag:
			print('NO')
		else:
			print('YES')


import sys, collections, math, itertools, random, bisect
INF = sys.maxsize

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

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

def input():
	return sys.stdin.readline().strip()
mod = int(1000000000.0 + 7)
for _ in range(int(input())):
	n = int(input())
	arr = get_array()
	s = set()
	for i in arr:
		s.add(i)
	if len(s) != n:
		print('NO')
		continue
	v = list(s)
	v.sort()
	sum = 0
	flag = True
	for i in range(n - 1, -1, -1):
		v[i] -= sum
		if v[i] > 0 and v[i] % (2 * (i + 1)) == 0:
			v[i] //= 2 * (i + 1)
			sum += 2 * v[i]
		else:
			flag = False
			break
	print('YES' if flag else 'NO')


import bisect
from itertools import accumulate
import os
import sys
import math
from decimal import *
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))

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

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

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

def primefactors(n):
	fac = []
	while n % 2 == 0:
		fac.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 2):
		while n % i == 0:
			fac.append(i)
			n = n // i
	if n > 1:
		fac.append(n)
	return fac

def factors(n):
	fac = set()
	fac.add(1)
	fac.add(n)
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			fac.add(i)
			fac.add(n // i)
	return list(fac)
from collections import Counter
for _ in range(int(input())):
	n = int(input())
	l1 = list(map(int, input().split()))
	d = Counter(l1)
	s = set(d.values())
	l = list(set(l1))
	l.sort(reverse=True)
	a = []
	ans = 0
	if len(s) == 1 and 2 in s:
		for i in range(n):
			x = (l[i] - 2 * ans) / (2 * (n - i))
			ans += x
			a.append(x)
			if x % 1 != 0 or x < 1:
				print('NO')
				break
		else:
			print('YES')
	else:
		print('NO')


from itertools import groupby
t = int(input())

def get(n, l):
	for i in range(n):
		if l[2 * i] != l[2 * i + 1]:
			return False
	sig = 0
	ans = []
	for i in range(n - 1, -1, -1):
		if (l[2 * i] - 2 * sig) % (2 * (i + 1)) != 0:
			return False
		temp = (l[2 * i] - 2 * sig) // (2 * (i + 1))
		ans.append(temp)
		sig += temp
	for i in range(1, n):
		if ans[i] <= 0 or ans[i] >= ans[i - 1]:
			return False
	return True
for _ in range(t):
	n = int(input())
	l = sorted(list(map(int, input().split())))
	print('YES' if get(n, l) else 'NO')


import sys

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

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

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

def insr():
	s = input()
	return s

def invr():
	return map(int, input().split())
n = inp()
for _ in range(n):
	x = inp()
	l = get_ints()
	l.sort()
	flag = 1
	lp = x * 2 - 1
	prevSum = 0
	prev = -1
	cnt = 0
	while lp > 0:
		if l[lp] != l[lp - 1]:
			flag = 0
			break
		if (l[lp] - prevSum) % (2 * (x - cnt)) != 0:
			flag = 0
			break
		prevNum = (l[lp] - prevSum) // (2 * (x - cnt))
		if prevNum <= 0 or prevNum == prev:
			flag = 0
			break
		prev = prevNum
		prevSum += 2 * prevNum
		cnt += 1
		lp -= 2
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	d = [int(d) for d in input().split()]
	d.sort(reverse=True)
	prev = d[0]
	done = 0
	i = 0
	while i < 2 * n:
		if d[i] == d[i + 1] and d[i] > 0:
			i = i + 2
		else:
			done = 1
			print('NO')
			break
	if done == 0:
		a = []
		c = 0
		i = 0
		dic = {}
		while i < 2 * n:
			if i == 0:
				if d[i] % (2 * n) == 0 and d[i] > 0:
					x = d[i] // (2 * n)
					a.append(x)
					dic[x] = 1
					i = i + 2
				else:
					print('NO')
					done = 1
					break
			else:
				c += 2 * a[-1]
				mod = 2 * n - i
				if (d[i] - c) % mod == 0 and d[i] - c > 0:
					x = (d[i] - c) // mod
					if x in dic:
						print('NO')
						done = 1
						break
					else:
						a.append(x)
						dic[x] = 1
						i = i + 2
				else:
					print('NO')
					done = 1
					break
		if done == 0:
			print('YES')


def hebing(s1, s2, s):
	i = j = 0
	a = len(s1)
	b = len(s2)
	while i + j != a + b:
		if s1[i] > s2[j]:
			s[i + j] = s2[j]
			j += 1
			if j == b:
				s[i + j:a + b] = s1[i:]
				break
		else:
			s[i + j] = s1[i]
			i += 1
			if i == a:
				s[i + j:a + b] = s2[j:]
				break

def paixu(s):
	n = len(s)
	if n <= 1:
		return None
	s1 = s[:n // 2]
	s2 = s[n // 2:]
	paixu(s1)
	paixu(s2)
	hebing(s1, s2, s)
n = int(input())
numlist = []
for i in range(n):
	input()
	numlist.append([int(num) for num in input().split()])
for i in numlist:
	paixu(i)
	comlist = []
	jg = 1
	for j in range(len(i) // 2):
		if i[2 * j] != i[2 * j + 1]:
			print('NO')
			jg = 0
			break
		comlist.append(i[2 * j])
		if j != 0:
			if comlist[j] == comlist[j - 1]:
				jg = 0
				print('NO')
				break
	if jg == 0:
		continue
	sumnum = 0
	for j in range(len(i) // 2 - 1, -1, -1):
		if (comlist[j] - sumnum) % (j * 2 + 2) != 0 or comlist[j] <= sumnum:
			print('NO')
			jg = 0
			break
		sumnum += (comlist[j] - sumnum) // (j + 1)
	if jg == 1:
		print('YES')


import os
import sys
from io import BytesIO, IOBase
import math
import itertools
import bisect
import heapq

def main():
	pass
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 binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(int(n))
	return l

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)

def countcon(s, i):
	c = 0
	ch = s[i]
	for i in range(i, len(s)):
		if s[i] == ch:
			c += 1
		else:
			break
	return c

def lis(arr):
	n = len(arr)
	lis = [1] * n
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] > arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
	maximum = 0
	for i in range(n):
		maximum = max(maximum, lis[i])
	return maximum

def isSubSequence(str1, str2):
	m = len(str1)
	n = len(str2)
	j = 0
	i = 0
	while j < m and i < n:
		if str1[j] == str2[i]:
			j = j + 1
		i = i + 1
	return j == m

def maxfac(n):
	root = int(n ** 0.5)
	for i in range(2, root + 1):
		if n % i == 0:
			return n // i
	return n

def p2(n):
	c = 0
	while n % 2 == 0:
		n //= 2
		c += 1
	return c

def seive(n):
	primes = [True] * (n + 1)
	primes[1] = primes[0] = False
	for i in range(2, n + 1):
		if primes[i]:
			for j in range(i + i, n + 1, i):
				primes[j] = False
	p = []
	for i in range(0, n + 1):
		if primes[i]:
			p.append(i)
	return p

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def denofactinverse(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return pow(fac, m - 2, m)

def numofact(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return fac
for xyz in range(0, int(input())):
	n = int(input())
	l = sorted(list(map(int, input().split())))
	cnt = {}
	ans = 'YES'
	for i in l:
		if i % 2:
			ans = 'NO'
			break
		if i in cnt:
			cnt[i] += 1
		else:
			cnt[i] = 1
	if ans == 'NO':
		print(ans)
	else:
		for i in cnt:
			if cnt[i] != 2:
				ans = 'NO'
				break
		if ans == 'NO':
			print(ans)
		else:
			l = l[::-2]
			coe = 2 * n
			tbm = 0
			ans = 'YES'
			for i in range(0, n):
				l[i] -= tbm
				if l[i] > 0 and l[i] % coe == 0:
					temp = l[i] // coe
					tbm += 2 * temp
					coe -= 2
				else:
					ans = 'NO'
					break
			print(ans)


def check(n, ds):
	ds = sorted(ds, reverse=True)
	tot = 0
	a_prev = 0
	for i in range(n):
		if ds[2 * i] != ds[2 * i + 1]:
			return False
		if (ds[2 * i] - tot) % (2 * (n - i)) != 0:
			return False
		a = (ds[2 * i] - tot) // (2 * (n - i))
		if a <= 0 or a == a_prev:
			return False
		tot += 2 * a
		a_prev = a
	return True

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		ds = list(map(int, input().split()))
		print('YES' if check(n, ds) else 'NO')
main()


try:
	for _ in range(int(input())):
		n = int(input())
		arr = list(map(int, input().split()))
		arr.sort(reverse=True)
		prev = 0
		p = 0
		s = set()
		flag = 0
		i = 0
		n = 2 * n
		while i < n:
			if arr[i] != arr[i + 1]:
				flag = 1
				break
			arr[i] -= prev
			x = arr[i] // (n - p)
			if arr[i] % (n - p) != 0 or arr[i] < n - p:
				flag = 1
				break
			s.add(x)
			p += 2
			prev += 2 * x
			i += 2
		if len(s) == n // 2 and flag == 0:
			print('YES')
		else:
			print('NO')
except:
	pass


import sys
input = sys.stdin.readline
from sys import stdin, stdout
from collections import defaultdict, Counter
M = 10 ** 9 + 7

def main():
	for _ in range(int(input())):
		n = int(input())
		d = sorted([int(s) for s in input().split()], reverse=True)
		a = 0
		ass = set()
		flag = 0
		for i in range(0, 2 * n, 2):
			if d[i] == d[i + 1]:
				if (d[i] - 2 * a) % (2 * n - i) == 0:
					w = (d[i] - 2 * a) // (2 * n - i)
					if w <= 0 or w in ass:
						flag = 1
						break
					a += w
					ass.add(w)
				else:
					flag = 1
					break
			else:
				flag = 1
				break
		if flag:
			print('NO')
		else:
			print('YES')
main()


for _ in range(int(input())):
	n = int(input())
	l = [*map(int, input().split())]
	l.sort()
	if l[0::2] != l[1::2] or len(set(l)) != n:
		print('NO')
		continue
	l1 = l[-1:0:-2]
	z = [0] * n
	cnt = n
	add = 0
	val = 0
	for i in range(n):
		z[i] = (l1[i] - add) / cnt
		add += z[i]
		cnt -= 1
		if z[i] > 0 and (z[i] / 2).is_integer():
			val += 1
	z1 = [i / 2 for i in z]
	z2 = z1.copy()
	z2.sort(reverse=True)
	if val == n and z2 == z1:
		print('YES')
	else:
		print('NO')


import sys
T = int(sys.stdin.readline().strip())
while T > 0:
	T -= 1
	n = int(sys.stdin.readline().strip())
	b = sys.stdin.readline().strip().split(' ')
	b = list(map(lambda x: int(x), b))
	a = sorted(b, reverse=True)
	sum = 0
	flag = True
	cnt = {}
	for i in range(len(a) // 2):
		if a[i * 2] != a[i * 2 + 1]:
			print('NO')
			flag = False
			break
		one = a[i * 2]
		if one % 2 != 0:
			print('NO')
			flag = False
			break
		t = one // 2
		if t <= sum:
			print('NO')
			flag = False
			break
		if (t - sum) % n == 0:
			if (t - sum) // n in cnt:
				print('NO')
				flag = False
				break
			cnt[(t - sum) // n] = 1
			sum += (t - sum) // n
			n -= 1
		else:
			print('NO')
			flag = False
			break
	if flag:
		print('YES')


def yesno(string, n):
	d = list(map(int, string.split()))
	d.sort()
	if d[::2] == d[1::2]:
		d = d[::2]
		if d[0] % 2:
			return 'NO'
		sumai = d[0] // 2
		for i in range(n - 1):
			if d[i + 1] == d[i] or (d[i + 1] - d[i]) % (2 * (i + 1)):
				return 'NO'
			else:
				sumai -= (n - i - 1) * ((d[i + 1] - d[i]) // (2 * (i + 1)))
		if sumai > 0 and (not sumai % n):
			return 'YES'
	return 'NO'
for x in range(int(input())):
	n = int(input())
	string = input()
	print(yesno(string, n))


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	t = set()
	ans = 'YES'
	for i in a:
		t.add(i)
		if i % 2:
			ans = 'NO'
	if len(t) != n:
		ans = 'NO'
	if ans == 'YES':
		no = []
		for i in t:
			no.append(i)
		no.sort()
		vl = 0
		divide_by = 2 * n
		while no:
			ck = no.pop() - vl
			if ck <= 0:
				ans = 'NO'
				break
			if ck % divide_by:
				ans = 'NO'
				break
			vl += ck // divide_by * 2
			divide_by -= 2
	print(ans)


for testcase in range(int(input())):
	n = int(input())
	arr = [int(x) for x in input().split()]
	d = {}
	for ele in arr:
		if ele in d:
			d[ele] += 1
		else:
			d[ele] = 1
	f = 0
	for ele in d:
		if d[ele] != 2:
			print('NO')
			f = 1
			break
	if f:
		continue
	s = set(arr)
	if len(s) != n:
		print('NO')
	else:
		arr = list(s)
		arr.sort()
		s1 = 0
		ans = []
		for i in range(n - 1, -1, -1):
			if i == n - 1:
				b = arr[i]
				c = 2 * n
				if b % c != 0:
					print('NO')
					break
				a = b // c
				a = int(a)
				ans.append(a)
				s1 += a
			else:
				b = arr[i] - 2 * s1
				c = 2 * (i + 1)
				if b % c != 0:
					print('NO')
					break
				a = b // c
				if a > ans[-1] or a <= 0:
					print('NO')
					break
				else:
					a = int(a)
					s1 += a
					ans.append(a)
		else:
			print('YES')


from collections import Counter

def double(dl):
	for it in dl.keys():
		if dl[it] != 2:
			return False
		if it % 2 == 1:
			return False
	return True
for _ in range(int(input())):
	__ = input()
	d = [int(i) for i in input().split(' ')]
	if len(d) == 2:
		if d[0] == d[1] and d[0] % 2 == 0:
			print('YES')
		else:
			print('NO')
	else:
		dl = dict(Counter(d))
		if not double(dl):
			print('NO')
		else:
			rs = False
			result = False
			keys = list(dl.keys())
			keys.sort(reverse=True)
			delta = []
			for i in range(1, len(keys)):
				n = (len(keys) - i) * 2
				x = keys[i - 1] - keys[i]
				if x % n != 0:
					rs = True
					break
				else:
					delta.append((keys[i - 1] - keys[i]) // n)
			if rs:
				print('NO')
			else:
				rs = False
				if keys[0] % (len(keys) * 2) != 0:
					print('NO')
				else:
					start = keys[0] // (len(keys) * 2)
					a = []
					a.append(start)
					for it in delta:
						k = a[-1] - it
						a.append(k)
						if k <= 0:
							print('NO')
							rs = True
							break
					if not rs:
						print('YES')


import math
import sys
input = sys.stdin.readline
from collections import defaultdict
for t in range(int(input())):
	n = int(input())
	d = defaultdict(list)
	arr = [int(i) for i in input().split()]
	flag = True
	for i in range(2 * n):
		if arr[i] % 2 == 1:
			flag = False
			break
		if arr[i] in d.keys():
			d[arr[i]] += [i]
		else:
			d[arr[i]] = [i]
	for i in d.keys():
		if len(d[i]) != 2:
			flag = False
			break
	if not flag:
		print('NO')
		continue
	arr = list(d.keys())
	arr.sort()
	arr.reverse()
	ans = [0] * n
	pre_sum = [0] * (n + 1)
	for i in range(n):
		ans[i] = (arr[i] - 2 * pre_sum[i]) / (2 * (n - i))
		if math.floor(ans[i]) != ans[i]:
			flag = False
			break
		pre_sum[i + 1] = pre_sum[i] + ans[i]
	ans = [int(i) for i in ans]
	for i in ans:
		if i < 0:
			flag = False
			break
	if not flag or 0 in ans or len(ans) != len(list(set(ans))):
		print('NO')
	else:
		print('YES')


import math
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for w in range(int(input())):
	n = int(input())
	d = list(map(int, input().split()))
	d = sorted(d)
	c = 0
	l = []
	dic = {}
	for i in range(0, 2 * n, 2):
		if d[i] != d[i + 1]:
			c = 1
			break
	if c == 1:
		print('NO')
	else:
		for i in range(0, 2 * n, 2):
			l.append(d[i])
		x = 0
		count = 0
		i = n - 1
		while i >= 0:
			x1 = (l[i] - x) / (2 * (i + 1))
			x2 = (l[i] - x) // (2 * (i + 1))
			count += 1
			if x1 != x2 or x1 <= 0:
				c = 1
				break
			else:
				x += x2 * 2
				if x2 not in dic:
					dic[x2] = 1
				else:
					c = 1
					break
			i -= 1
		if c == 1:
			print('NO')
		else:
			print('YES')


for _ in range(int(input())):
	n = int(input())
	p = list(map(int, input().split()))
	d = {}
	for i in p:
		if i not in d:
			d[i] = 1
		else:
			d[i] += 1
	f2 = 0
	for i in d:
		if d[i] % 2 == 1:
			f2 = 1
	for i in p:
		if i % 2 == 1:
			f2 = 1
	if len(set(p)) != n:
		f2 = 1
	if f2:
		print('NO')
	else:
		arr = list(set(p))
		arr.sort(reverse=True)
		prev_sum = 0
		flag = True
		s = set()
		for i in arr:
			num = i - prev_sum
			den = 2 * n
			if num <= 0:
				flag = False
				break
			if num % den != 0:
				flag = False
				break
			curr = num // den
			n -= 1
			prev_sum += 2 * curr
		if flag:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	n = int(input()) * 2
	c = sorted(list(map(int, input().split())), reverse=True)
	d = set()
	a = 0
	f = 0
	for i in range(n):
		if i % 2 == 0:
			if (c[i] - a) % (n - i) == 0 and (c[i] - a) / (n - i) >= 1:
				e = (c[i] - a) / (n - i)
				if e in d:
					f = 1
					print('NO')
					break
				else:
					d.add(e)
					a += 2 * e
			else:
				print('NO')
				f = 1
				break
		elif c[i] != c[i - 1]:
			print('NO')
			f = 1
			break
	if f == 0:
		print('YES')


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	if a[-1] == 0:
		print('NO')
	else:
		flag = True
		prev = -1
		for j in range(0, 2 * n, 2):
			if not (a[j] == a[j + 1] and a[j] != prev and (a[j] % 2 == 0)):
				flag = False
				break
			prev = a[j]
		if flag:
			s = 0
			x = 2 * n
			flag = True
			prev = 10 ** 13
			for j in range(0, x, 2):
				if a[j] - s > 0 and (a[j] - s) % (x - j) == 0:
					newvar = (a[j] - s) // (x - j)
					s += 2 * newvar
					if prev != newvar:
						prev = newvar
					else:
						flag = False
						break
				else:
					flag = False
					break
			if prev != 0 and flag:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')


import sys

def solve():
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	a.sort()
	if a[0] == 0:
		print('NO')
		return
	for i in range(2 * n):
		if a[i] % 2 == 1:
			print('NO')
			return
	for i in range(n):
		if a[2 * i] != a[2 * i + 1]:
			print('NO')
			return
	for i in range(n - 1):
		if a[2 * i] == a[2 * i + 2]:
			print('NO')
			return
	b = [a[2 * i] / 2 for i in range(n)]
	b.reverse()
	c = [0] * n
	tot = 0
	for i in range(n):
		b[i] -= tot
		within = n - i
		if b[i] % within != 0 or b[i] <= 0:
			print('NO')
			return
		c[i] = int(b[i] / within)
		tot += c[i]
	for i in range(n - 1):
		if c[i] <= c[i + 1]:
			print('NO')
			return
	print('YES')
t = int(sys.stdin.readline())
for tc in range(t):
	solve()


from collections import defaultdict
from heapq import heappush, heappop
for _ in range(int(input())):
	n = int(input())
	d = map(int, input().split())
	sd = []
	dic = defaultdict(lambda : 0)
	odd_avail = False
	for el in d:
		if dic[el] == 0:
			heappush(sd, -el)
		dic[el] += 1
		if el % 2 != 0:
			odd_avail = True
	if odd_avail or len(sd) != n:
		print('NO')
		continue
	else:
		prev_sum = 0
		ans = 'YES'
		for i in range(n):
			temp = -heappop(sd)
			ki = (temp - prev_sum) / (2 * (n - i))
			prev_sum += 2 * ki
			if not ki.is_integer() or ki <= 0:
				ans = 'NO'
				break
		print(ans)


def merge(array, begin, half, end):
	copy_array = list()
	i = begin
	j = half + 1
	while i <= half and j <= end:
		if array[i] < array[j]:
			copy_array.append(array[i])
			i += 1
		else:
			copy_array.append(array[j])
			j += 1
	while i <= half:
		copy_array.append(array[i])
		i += 1
	while j <= end:
		copy_array.append(array[j])
		j += 1
	k = 0
	i = begin
	while i <= end:
		array[i] = copy_array[k]
		i += 1
		k += 1

def mergesort(array, begin, end):
	if end <= begin:
		return
	half = int(begin + (end - begin) / 2)
	mergesort(array, begin, half)
	mergesort(array, half + 1, end)
	merge(array, begin, half, end)
	return

def main():
	test_cases = int(input())
	for _ in range(test_cases):
		n = int(input())
		a_i = [int(num) for num in input().split()]
		b_i = list()
		d_i = list()
		a_i = [num for num in reversed(sorted(a_i))]
		right = True
		for i in range(n):
			if a_i[i * 2] != a_i[i * 2 + 1]:
				right = False
				break
			b_i.append(a_i[i * 2])
		i = 1
		while i < n and right:
			if b_i[i - 1] == b_i[i] or (b_i[i - 1] - b_i[i]) % (2 * (n - i)) != 0:
				right = False
				break
			d_i.append((b_i[i - 1] - b_i[i]) / 2 / (n - i))
			i += 1
		i = 1
		while i < n and right:
			b_i[n - 1] -= 2 * i * d_i[i - 1]
			i += 1
		if not right:
			print('NO')
		elif b_i[n - 1] <= 0 or b_i[n - 1] % (2 * n) != 0:
			print('NO')
		else:
			print('YES')
main()


from sys import stdin, stdout, maxsize
from math import sqrt, log, factorial, gcd
from collections import defaultdict as D, OrderedDict as OD
from bisect import insort
for _ in range(int(input())):
	n = int(input())
	d = list(map(int, stdin.readline().strip().split()))
	d.sort()
	flag = 0
	for i in range(0, 2 * n, 2):
		if d[i] != d[i + 1]:
			flag = 1
			break
	if flag:
		print('NO')
		continue
	d1 = [0] * n
	for i in range(0, 2 * n, 2):
		d1[i // 2] = d[i]
	found = False
	for i in range(n):
		if d1[i] % 2 == 1:
			found = True
			break
		d1[i] //= 2
	if found:
		print('NO')
	else:
		hold = True
		prev = 0
		factor = n
		for i in range(n - 1, -1, -1):
			if d1[i] - prev <= 0:
				hold = False
				break
			else:
				d1[i] -= prev
				if d1[i] % factor != 0:
					hold = False
					break
				else:
					d1[i] //= factor
					prev += d1[i]
			factor -= 1
		if hold:
			freq = D(lambda : 0)
			for i in d1:
				freq[i] += 1
			if freq[0] > 0:
				print('NO')
			else:
				for i in freq:
					if freq[i] > 1:
						print('NO')
						break
				else:
					print('YES')
		else:
			print('NO')


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
r = 1
while r <= T:
	n = int(input())
	arr = list(map(int, input().split()))
	arr = sorted(arr)
	collect = []
	ans = 'YES'
	base = 0
	for i in range(n):
		big1 = arr.pop()
		big2 = arr.pop()
		if big1 != big2 or big1 + big2 - base * 2 <= 0:
			ans = 'NO'
			break
		if (big1 + big2 - base * 2) % (2 * n - 2 * i) > 0:
			ans = 'NO'
			break
		collect.append((big1 + big2 - base * 2) // (2 * n - 2 * i))
		base += collect[-1]
		if len(collect) > 1 and (collect[-2] <= collect[-1] or (collect[-2] - collect[-1]) % 2 > 0):
			ans = 'NO'
			break
	if ans == 'YES' and (collect[-1] % 2 > 0 or collect[-1] <= 0):
		ans = 'NO'
	print(ans)
	r += 1


from collections import Counter
t = int(input())
for i in range(t):
	n = int(input())
	d = list(map(int, input().split()))
	d1 = Counter(d)
	flag = 0
	for j in d1:
		if d1[j] != 2 or j % 2 != 0:
			print('NO')
			flag = 1
			break
	s = set(d)
	s = list(s)
	s.sort(reverse=True)
	s1 = n
	sum1 = 0
	if flag == 0:
		for k in range(len(s)):
			s[k] = s[k] // 2
			s[k] = s[k] - sum1
			if s[k] % s1 != 0 or s[k] <= 0:
				print('NO')
				flag = 1
				break
			sum1 = sum1 + s[k] // s1
			s1 = s1 - 1
	if flag == 0:
		print('YES')


gans = []
for _ in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	s.sort()
	s1 = s[:]
	ok = False
	d = []
	for i in range(1, 2 * n, 2):
		if s[i] != s[i - 1] or s[i] % 2 != 0:
			gans.append('NO')
			ok = True
			break
		d.append(s[i] // 2)
	if ok:
		continue
	sm = d[0]
	for i in range(n):
		d[i] -= sm
	a = [0] * n
	a[-1] = (d[-1] + sm) // n
	if (d[-1] + sm) % n != 0 or a[-1] <= 0:
		gans.append('NO')
		continue
	sm -= a[-1]
	for i in range(n - 2, -1, -1):
		a[i] = (d[i] + sm) // (i + 1)
		sm -= a[i]
		if (d[i] + sm + a[i]) % (i + 1) != 0 or a[i] <= 0 or a[i] == a[i + 1]:
			gans.append('NO')
			break
	else:
		gans.append('YES')
print('\n'.join(gans))


import sys

def solution():
	N = int(sys.stdin.readline().rstrip())
	s = list(set(map(int, sys.stdin.readline().rstrip().split())))
	s.sort()
	prev = 0
	counter = 0
	if len(s) != N:
		print('NO')
		return
	for i in range(len(s)):
		if s[i] % 2 == 1:
			break
		s[i] /= 2
		if i != 0:
			if s[i] == prev:
				break
			if (s[i] - prev) % counter != 0:
				break
			s[0] -= (s[i] - prev) // counter * (N - counter)
		prev = s[i]
		counter += 1
	else:
		if s[0] <= 0:
			print('NO')
			return
		if s[0] % N != 0:
			print('NO')
			return
		print('YES')
		return
	print('NO')
TC = int(sys.stdin.readline().rstrip())
for i in range(TC):
	solution()


from collections import Counter
from sys import stdin
input = stdin.readline

def solve(n):
	a = list(map(int, input().split()))
	con = True
	counter = Counter(a)
	s = sorted(list(set(a)))
	if max(counter.values()) != 2 or min(counter.values()) != 2:
		con = False
	x = len(s)
	su = 0
	for i in range(x, 0, -1):
		y = s[i - 1] - su
		if y >= 0 and y % (2 * i) or y <= 0:
			con = False
			break
		else:
			su += 2 * (y // (2 * i))
	if con == True:
		print('YES')
	else:
		print('NO')
t = int(input())
for i in range(t):
	n = int(input())
	solve(n)


def f(n, t, d):
	if d in str(n):
		f(n + 1)
t = int(input())
while t:
	t -= 1
	n = int(input())
	d = list(map(int, input().split()))
	d.sort()
	d.reverse()
	sett = set()
	s = 0
	A = []
	for i in range(2 * n):
		if i % 2 == 0:
			if (d[i] - s) % (2 * n - i) or d[i] - s <= 0:
				break
			else:
				a = (d[i] - s) // (2 * n - i)
				s += a * 2
				sett.add(a)
				A.append(a)
		elif d[i] != d[i - 1]:
			sett = set()
			break
	for i in range(len(A) - 1):
		if A[i] <= A[i + 1]:
			sett = set()
			break
	if len(sett) == n:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.buffer.readline
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = []
	flag = 0
	for i in range(0, 2 * n, 2):
		if a[i] == a[i + 1]:
			b.append(a[i])
		else:
			print('NO')
			flag = 1
			continue
	if flag == 1:
		continue
	d = []
	count = 2
	flag = 0
	for i in range(1, n):
		d.append((b[i] - b[i - 1]) / count)
		count += 2
	i = n - 2
	flag = 0
	ans = b[-1] / (2 * n)
	p_ans = ans
	if ans % 1 > 0:
		flag = 1
	while i >= 0:
		ans -= d[i]
		if ans % 1 > 0 or ans == p_ans:
			flag = 1
		p_ans = ans
		i -= 1
	if ans <= 0 or flag == 1:
		print('NO')
	else:
		print('YES')


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	i = 0
	lis = []
	x = 0
	while i < 2 * n:
		if arr[i] != arr[i + 1]:
			x += 1
			break
		else:
			lis.append(arr[i])
			i += 2
	if x == 1:
		print('NO')
	else:
		s = lis[0]
		for i in range(n - 1):
			if lis[i] == lis[i + 1]:
				x += 1
				break
		if s % 2 == 1 or x == 1:
			print('NO')
		else:
			num = [0]
			a = 0
			for i in range(1, n):
				if lis[i] % 2 != 0:
					x += 1
					break
				else:
					lis[i] -= s
					lis[i] = lis[i] // 2
					if (a + lis[i]) % i != 0:
						x += 1
						break
					else:
						num.append((a + lis[i]) // i)
				a += num[-1]
			if x == 1:
				print('NO')
			else:
				s = s // 2
				s -= a
				if s <= 0 or s % n != 0:
					print('NO')
				else:
					print('YES')


def solve(n, D):
	if n == 1:
		if D[0] == D[1] and D[0] % 2 == 0:
			return 'YES'
		else:
			return 'NO'
	D = sorted(D)[::-1]
	pre = None
	diffs = []
	for (i, d) in enumerate(D):
		if pre is None:
			pre = d
			continue
		if i % 2 == 1:
			if d != pre:
				return 'NO'
			else:
				continue
		if (pre - d) % (2 * n - i) != 0:
			return 'NO'
		diff = (pre - d) / (2 * n - i)
		if diff == 0:
			return 'NO'
		diffs.append(diff)
		pre = d
	diffs = diffs[::-1]
	dist = 0
	total = 0
	for diff in diffs:
		dist += diff
		total += dist
	if d - 2 * total > 0 and (d - 2 * total) % (2 * n) == 0:
		return 'YES'
	else:
		return 'NO'

def main():
	ans = []
	t = int(input())
	for _ in range(t):
		n = int(input())
		D = list(map(int, input().split(' ')))
		ans.append(solve(n, D))
	for a in ans:
		print(a)
main()


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

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

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

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

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

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
for _ in range(int(inp())):
	n = int(inp())
	arr = lmp()
	md = dd(int)
	for i in range(2 * n):
		md[arr[i]] += 1
	t = True
	ml = []
	for (k, v) in md.items():
		if v != 2:
			t = False
			break
		ml.append(k)
	if not t:
		print('NO')
		continue
	ml.sort(reverse=True)
	i = 0
	prev = 0
	p = 2 * n
	while i < n:
		ml[i] -= prev
		if ml[i] <= 0:
			t = False
			break
		if ml[i] % p != 0:
			t = False
			break
		p -= 2
		prev += ml[i] / (n - i)
		i += 1
	print('YES' if t else 'NO')


import os
import sys
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')

def solve():
	global d
	d.sort()
	for i in range(n):
		if d[i * 2] != d[i * 2 + 1]:
			return False
	d = d[::2]
	s = [d[i] - d[i - 1] for i in range(1, n)]
	diff = [0] * n
	for (i, dd) in enumerate(s, start=1):
		if dd % (i * 2) != 0:
			return False
		if dd == 0:
			return False
		diff[i] = dd // 2 // i + diff[i - 1]
	nx = d[0] // 2 - sum(diff)
	x = nx // n
	if nx % n != 0:
		return False
	if x <= 0:
		return False
	if (x * n + sum(diff)) * 2 != d[0]:
		return False
	return True
for _ in range(int(input())):
	n = int(input())
	d = list(map(int, input().split()))
	print('YES' if solve() else 'NO')


import sys
input = sys.stdin.buffer.readline
for t in range(int(input())):
	N = int(input())
	D = list(map(int, input().split()))
	if N == 1:
		if len(set(D)) == 1 and D[0] & 1 == 0 and (D[0] > 0):
			print('YES')
		else:
			print('NO')
		continue
	F = 0
	for i in range(N * 2):
		if D[i] & 1 or D[i] == 0:
			F = 1
	D.sort()
	for i in range(N):
		if D[i * 2] != D[i * 2 + 1]:
			F = 1
	X = [D[i << 1] for i in range(N)]
	X = X[::-1]
	Y = 0
	if X[0] % (N * 2) or F:
		print('NO')
		continue
	Z = [0] * N
	F = 0
	for i in range(1, N):
		Z[i] = (X[i - 1] - X[i]) // (N * 2 - i * 2)
		if (X[i - 1] - X[i]) % (N * 2 - i * 2):
			print('NO')
			F = 1
			break
	if F:
		continue
	V = [0] * N
	V[0] = X[0] // (N * 2)
	for i in range(N - 1):
		V[i + 1] = V[i] - Z[i + 1]
	if min(V) <= 0 or len(set([abs(V[i]) for i in range(N)])) != N:
		print('NO')
	else:
		print('YES')


import os
import sys
from collections import Counter
from io import BytesIO, IOBase
from math import gcd, inf, sqrt

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

def getFactorization(x):
	ret = list()
	while x != 1:
		ret.append(spf[x])
		x = x // spf[x]
	return ret

def printDivisors(n):
	i = 2
	z = [1, n]
	while i <= sqrt(n):
		if n % i == 0:
			if n / i == i:
				z.append(i)
			else:
				z.append(i)
				z.append(n // i)
		i = i + 1
	return z

def cheaker(a):
	j = 1
	p = False
	for i in a:
		if i != j:
			break
		j += 1
	q = len(a)
	for i in a[::-1]:
		if i != q:
			break
		q -= 1
	for i in range(j - 1, q):
		if a[i] == i + 1:
			return False
	return True

def create(n, x, f):
	pq = len(bin(n)[2:])
	if f == 0:
		tt = min
	else:
		tt = max
	dp = [[inf] * n for _ in range(pq)]
	dp[0] = x
	for i in range(1, pq):
		for j in range(n - (1 << i) + 1):
			dp[i][j] = tt(dp[i - 1][j], dp[i - 1][j + (1 << i - 1)])
	return dp

def enquiry(l, r, dp, f):
	if l > r:
		return inf if not f else -inf
	if f == 1:
		tt = max
	else:
		tt = min
	pq1 = len(bin(r - l + 1)[2:]) - 1
	return tt(dp[pq1][l], dp[pq1][r - (1 << pq1) + 1])

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

def main():
	for i in range(int(input())):
		n = int(input())
		a = [int(x) for x in input().split()]
		z = Counter(a)
		an = 1
		a.sort()
		for ii in z:
			if z[ii] > 2 or ii % 2 == 1 or z[ii] == 1:
				an = -1
				break
		if an == -1:
			print('NO')
		else:
			temp = 2 * n
			s = 0
			c = 0
			ele = 0
			x = []
			for j in range(len(a) - 1, -1, -2):
				a[j] -= s
				if a[j] % temp != 0 or a[j] <= 0:
					an = -1
					break
				else:
					ele = a[j] // temp
					x.append(ele)
				s += 2 * ele
				c += 1
				temp = 2 * (n - c)
			if an == -1 or len(set(x)) != 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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for i in range(t):
	n = int(input())
	l1 = input().split(' ')
	dList = [int(x) for x in l1]
	dList.sort(reverse=True)
	s = 0
	flag = False
	n = n * 2
	for j in range(0, n, 2):
		if dList[j] != dList[j + 1]:
			flag = True
			break
	if flag:
		print('NO')
		continue
	dList = [dList[k] for k in range(0, n, 2)]
	n = n // 2
	a = -1
	for j in range(n):
		dList[j] -= s
		if dList[j] % (2 * (n - j)) != 0 or dList[j] <= 0:
			flag = True
			break
		b = dList[j] // (n - j)
		if a == b:
			flag = True
			break
		a = b
		s += a
	if flag:
		print('NO')
	else:
		print('YES')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	g = 1
	d = {}
	for i in l:
		if i in d:
			d[i] += 1
		else:
			d[i] = 1
	for i in d:
		if d[i] != 2:
			g = 0
			break
	if g:
		s = set(l)
		p = list(s)
		p.sort(reverse=True)
		f = 1
		cnt = 0
		som = 0
		pr = 10 ** 18
		for i in p:
			if (i - som) % (2 * (n - cnt)) == 0:
				v = (i - som) // (2 * (n - cnt))
				som += v * 2
				cnt += 1
				if v <= 0:
					f = 0
					break
				if v > pr:
					f = 0
					break
				pr = v
			else:
				f = 0
				break
		if f:
			sys.stdout.write('YES' + '\n')
		else:
			sys.stdout.write('NO' + '\n')
	else:
		sys.stdout.write('NO' + '\n')


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	l1 = list(map(int, input().split()))
	d = Counter(l1)
	s = list(set(d.values()))
	l = list(set(l1))
	l.sort(reverse=True)
	a = []
	ans = 0
	if len(s) == 1 and s[0] == 2:
		for i in range(n):
			x = (l[i] - 2 * ans) / (2 * (n - i))
			ans += x
			a.append(x)
			if x % 1 != 0 or x < 1:
				print('NO')
				break
		else:
			print('YES')
	else:
		print('NO')


import sys
import os
import io
from sys import stdin
from math import log, gcd, ceil
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
import math
from bisect import bisect_left, bisect_right
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

def power(x, y, p):
	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 SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	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 countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def si():
	return input()
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

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

def divideCeil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

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

def li():
	return list(map(int, input().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')
t = 1
t = int(input())
for _ in range(t):
	n = ii()
	d = li()
	l = []
	dic = defaultdict(lambda : 0)
	for i in d:
		dic[i] += 1
	f = 0
	for i in dic.keys():
		if dic[i] == 2:
			l += [i] * (dic[i] // 2)
		else:
			f = 1
			break
	if f == 1:
		print('NO')
		continue
	l.sort()
	an = 0
	ite = 0
	ans = []
	for i in range(n - 1, -1, -1):
		if l[i] % 2 != 0:
			f = 1
			break
		elif (l[i] // 2 - an) % (n - ite) != 0:
			f = 1
			break
		else:
			if (l[i] // 2 - an) // (n - ite) <= 0:
				f = 1
				break
			an += (l[i] // 2 - an) // (n - ite)
			ite += 1
	if f == 0:
		print('YES')
	else:
		print('NO')


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

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

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

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

def getls():
	return list(map(str, input().strip().split()))

def gets():
	return input().strip()

def geta():
	return int(input())

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

def solve():
	for _ in range(geta()):
		n = geta()
		a = getl()
		count = Counter(a)
		if any((i & 1 for i in a)):
			print('NO')
			continue
		if list(set(count.values())) != [2]:
			print('NO')
			continue
		ans = sorted(list(count), reverse=True)
		prev = 0
		for i in range(len(ans)):
			if (ans[i] - prev * 2) % (2 * (n - i)) != 0:
				print('NO')
				break
			temp = (ans[i] - prev * 2) // (2 * (n - i))
			if temp <= 0:
				print('NO')
				break
			prev += temp
		else:
			print('YES')
solve()


ll = lambda : map(int, input().split())
t = lambda : int(input())
ss = lambda : input()
from collections import Counter
for _ in range(t()):
	n = t()
	d = list(ll())
	x = Counter(d)
	p = 0
	for i in x.values():
		if i != 2:
			print('NO')
			p = 1
			break
	if p:
		continue
	s = 0
	c = len(x.keys())
	for i in sorted(x.keys())[::-1]:
		i = i - s
		if i > 0 and i % (2 * c) == 0:
			i = i // (2 * c)
			s += 2 * i
		else:
			print('NO')
			break
		c -= 1
	else:
		print('YES')


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)]

def isInt(s):
	return '0' <= s[0] <= '9'
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	D = getInts()
	DC = dc(D)
	for key in DC:
		if DC[key] != 2:
			return 'NO'
	D = list(set(D))
	D.sort()
	curr_sum = 0
	while D:
		diff = D.pop()
		diff -= 2 * curr_sum
		if diff % (2 * N) != 0 or diff < 1:
			return 'NO'
		curr_sum += diff // (2 * N)
		N -= 1
	return 'YES'
for _ in range(getInt()):
	print(solve())


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	c = 0
	for j in range(n):
		if a[2 * j] != a[2 * j + 1]:
			c = c + 1
	if c > 0:
		print('NO')
	else:
		k = 2 * n
		sumo = 0
		c1 = 0
		b = []
		for j in range(n):
			b.append(a[2 * j])
		s = set()
		for j in range(n - 1, -1, -1):
			if (b[j] - sumo) % k == 0 and b[j] > sumo:
				val = (b[j] - sumo) // k
				if val in s:
					c1 = c1 + 1
				s.add(val)
				sumo = sumo + 2 * val
				k = k - 2
			else:
				c1 = c1 + 1
		if c1 == 0:
			print('YES')
		else:
			print('NO')


Y = 'YES'
N = 'NO'
N = 'NO'
t = int(input().strip())
for i in range(t):
	n = int(input().strip())
	a = list(map(int, input().strip().split()))
	f = 1
	for j in range(n):
		if a[j] % 2:
			f = 0
			break
	if f == 0:
		print(N)
	else:
		a.sort(reverse=True)
		su = 0
		f = 0
		pre = -1
		for j in range(n):
			if a[j * 2] != a[j * 2 + 1] or (a[j * 2] - su) % (2 * (n - j)) != 0:
				f = 1
				break
			else:
				b = (a[j * 2] - su) // (2 * (n - j))
				if pre == b or b <= 0:
					f = 1
					break
				pre = b
				su += (a[j * 2] - su) // (2 * (n - j)) * 2
		if f:
			print(N)
		else:
			print(Y)


from math import floor
import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	d = list(map(int, input().split()))
	d.sort(reverse=True)
	for i in range(0, 2 * n, 2):
		if d[i] != d[i + 1]:
			print('NO')
			return
	a = [0] * n
	a[0] = d[0] / (2 * n)
	if floor(a[0]) != a[0]:
		print('NO')
		return
	for k in range(1, n):
		delta = d[2 * (k - 1)] - d[2 * k]
		a[k] = a[k - 1] - delta / (2 * (n - k))
		if floor(a[k]) != a[k] or a[k] <= 0 or a[k] == a[k - 1]:
			print('NO')
			return
	print('YES')
t = int(input())
for _ in range(t):
	solve()


def isPair(a):
	ret = 0
	for x in a:
		ret ^= x
	return ret == 0
T = int(input())
for cas in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if not isPair(a):
		print('NO')
		continue
	tot = 0
	b = [0 for i in range(2 * n + 2)]
	fl = True
	for i in range(2 * n, n, -1):
		if (a[2 * (i - n) - 1] - 2 * tot) % (2 * (i - n)):
			fl = False
			break
		b[i] = (a[2 * (i - n) - 1] - 2 * tot) // (2 * (i - n))
		if b[i] <= 0:
			fl = False
			break
		tot += b[i]
	for i in range(n + 1, 2 * n):
		if b[i] == b[i + 1]:
			fl = False
			break
	print('YES' if fl else 'NO')


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
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))

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()))
		a.sort()
		b = []
		f = 1
		for i in range(0, 2 * n - 1, 2):
			if a[i] != a[i + 1]:
				f = 0
				break
			if i > 0:
				if a[i] == a[i - 1]:
					f = 0
					break
		if f == 0:
			print('NO')
			continue
		a.reverse()
		curr = 0
		for i in range(0, 2 * n, 2):
			if (a[i] - 2 * curr) % (2 * (n - i // 2)) == 0:
				t = (a[i] - 2 * curr) // (2 * (n - i // 2))
				if t <= 0:
					f = 0
					break
			else:
				f = 0
				break
			curr += t
			b.append(t)
			b.append(-t)
		if f:
			b.sort()
			for i in range(1, 2 * n):
				if b[i] == b[i - 1]:
					f = 0
					break
			if f:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
	return
main()


from sys import stdin, stdout
input = stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	d = [int(x) for x in input().split()]
	c = {}
	for i in d:
		c[i] = c.get(i, 0) + 1
	d = sorted(set(d), reverse=True)
	if len(d) != n:
		print('no')
		continue
	count = n
	delta = 0
	ans = 'yes'
	for i in d:
		p = i - delta
		if p % (2 * count):
			ans = 'no'
			break
		else:
			val = p // (2 * count)
			if val <= 0:
				ans = 'no'
				break
			delta += c[i] * val
			count -= c[i] // 2
	print(ans)


import os
import sys
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')
for _ in range(int(input())):
	(n, d) = (int(input()), [*map(int, input().split())])
	ans = 'YES'
	k = n - 1
	e = sorted([*enumerate(d)], key=lambda x: x[1], reverse=True)
	prev = None
	s = 0
	tx = 0
	checker = set()
	prev_ans = None
	for (i, j) in e:
		if j % 2 != 0 or j == 0:
			ans = 'NO'
			break
		if tx % 2 == 0:
			prev = j
			num = j - 2 * s
			den = 2 * (1 + k)
			if num % den != 0 or num <= 0:
				ans = 'NO'
				break
			else:
				x = num // den
				s += x
				k -= 1
				if x not in checker:
					checker.add(x)
				else:
					ans = 'NO'
					break
				prev_ans = x
		elif j != prev:
			ans = 'NO'
			break
		else:
			prev = None
			if -prev_ans not in checker:
				checker.add(-prev_ans)
			else:
				ans = 'NO'
				break
		tx += 1
	print(ans)


def CheckAsymetrc():
	n = int(input())
	l1 = input().split(' ')
	nums = []
	SumNums = 0
	NumNums = 0
	for j in range(0, 2 * n):
		nums.append(int(l1[j]))
	nums.sort(reverse=True)
	for j in range(0, n):
		if nums[j * 2] != nums[j * 2 + 1]:
			print('NO')
			return
	for j in range(0, n - 1):
		if nums[j * 2] == nums[j * 2 + 2]:
			print('NO')
			return
	for j in range(0, n):
		tempNum = nums[j * 2] / 2
		tempNum -= SumNums
		if tempNum <= 0:
			print('NO')
			return
		if tempNum % (n - NumNums) != 0:
			print('NO')
			return
		tempNum = tempNum / (n - NumNums)
		NumNums += 1
		SumNums += tempNum
	print('YES')
	return
t = int(input())
for i in range(0, t):
	CheckAsymetrc()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().rstrip().split()))
	arr.sort(reverse=True)
	temp = []
	s = 0
	f = 0
	for i in range(0, 2 * n, 2):
		if arr[i] != arr[i + 1]:
			f = 1
			print('NO')
			break
	if f == 0:
		for i in range(0, 2 * n, 2):
			p = (arr[i] - 2 * s) / (2 * n - i)
			if p != int(p):
				print('NO')
				f = 1
				break
			if p <= 0:
				print('NO')
				f = 1
				break
			if len(temp) > 0 and temp[-1] == p:
				print('NO')
				f = 1
				break
			s += p
			temp.append(p)
		if f == 0:
			print('YES')


from pprint import pprint
import sys
input = sys.stdin.readline
import collections

def do():
	n = int(input())
	dat = list(map(int, input().split()))
	C = collections.Counter(dat)
	can = True
	buf = []
	for k in C.keys():
		if k % 2 != 0:
			print('NO')
			return
		if C[k] != 2:
			print('NO')
			return
		buf.append(k)
	buf.sort()
	p = -1
	dd = []
	for i in range(1, n):
		delta = buf[i] - buf[i - 1]
		dd.append(delta)
		p = delta
	ss = set()
	for i in range(len(dd)):
		d = 2 * (i + 1)
		if dd[i] % d != 0:
			print('NO')
			return
	k = buf[0] // 2
	res = []
	res.append(0)
	for i in range(len(dd)):
		delta = dd[i] // (2 * (i + 1))
		res.append(res[-1] + delta)
	sss = sum(res)
	if (k - sss) % n == 0:
		a = map(lambda x: x + (k - sss) // n, res)
		ss = set()
		for x in a:
			if x < 1:
				print('NO')
				return
			if x in ss:
				print('NO')
				return
			ss.add(x)
		print('YES')
	else:
		print('NO')
q = int(input())
for _ in range(q):
	do()


from sys import *
for _ in range(int(input())):
	n = int(stdin.readline())
	l = [int(x) for x in stdin.readline().split()]
	l.sort(reverse=True)
	flag = 0
	for i in range(1, 2 * n, 2):
		if l[i] != l[i - 1]:
			flag = 1
			break
	if flag:
		print('NO')
		continue
	t = n
	flag = 0
	st = 0
	m = []
	for i in range(1, 2 * n, 2):
		if (l[i] - st) % (2 * t) == 0:
			p = (l[i] - st) // t
			if p <= 0 or (len(m) > 0 and m[len(m) - 1] == p):
				flag = 1
				break
			m.append(p)
			st += p
			t -= 1
		else:
			flag = 1
			break
	if flag:
		print('NO')
	else:
		print('YES')


from sys import *
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	d = sorted(map(int, input().split()))
	ans = 'YES'
	if len(set(d)) != n:
		print('NO')
		continue
	(a, curr, till) = ([], 0, 0)
	for i in range(2 * n - 2, -1, -2):
		if d[i] != d[i + 1]:
			ans = 'NO'
			break
		d[i] -= till
		if d[i] > 0 and d[i] % (i + 2) == 0:
			d[i] //= i + 2
			till += d[i] * 2
		else:
			ans = 'NO'
			break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	t = 2 * n
	s = 0
	l = list(map(int, input().split()))
	q = set(l)
	if 2 * len(q) != t:
		print('NO')
		continue
	l = sorted(q, reverse=True)[:n]
	j = None
	for k in l:
		p = k - s
		if p <= 0 or p % t != 0:
			print('NO')
			break
		j = p // t
		s += 2 * j
		t -= 2
	else:
		print('YES')


import collections
import sys
input = sys.stdin.readline

def solve(n, a):
	c = collections.Counter(a)
	res = []
	for i in c:
		if c[i] != 2:
			return False
		res.append(i)
	res.sort()
	if res[-1] % (2 * n) != 0:
		return False
	l = res[-1] // (2 * n)
	tot = 2 * l
	for i in range(n - 2, -1, -1):
		if res[i] < tot:
			return False
		res[i] -= tot
		if res[i] == 0 or res[i] % ((i + 1) * 2) != 0:
			return False
		l = res[i] // ((i + 1) * 2)
		tot += 2 * l
	return True
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	res = solve(n, a)
	if res:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
T = int(input())
ans = []
for _ in range(T):
	N = int(input())
	X = list(map(int, input().split()))
	sx = sorted(X, reverse=True)
	invalid = False
	for (a, b) in zip(sx[::2], sx[1::2]):
		if a != b or a % 2:
			invalid = True
			break
	if invalid:
		ans.append('NO')
		continue
	k = N * 2
	s = 0
	used = set()
	for i in range(0, 2 * N, 2):
		x = sx[i]
		if x - s <= 0 or (x - s) % k:
			invalid = True
			break
		d = (x - s) // k
		if d in used:
			invalid = True
			break
		used.add(d)
		s += d * 2
		k -= 2
		if i == 2 * N - 1 and x != s:
			invalid = True
	ans.append('NO' if invalid else 'YES')
print(*ans, sep='\n')


for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	d = {}
	for i in a:
		d[i] = d.get(i, 0) + 1
	flag = 0
	for i in d.keys():
		if d[i] % 2 == 1 or i % 2 == 1:
			flag = 1
			break
	if flag or a[-1] % (2 * n) != 0:
		print('NO')
		continue
	a = list(d.keys())
	a.sort()
	val = a[-1] / n
	ct = val
	l = [val]
	for i in range(n - 1, 0, -1):
		x = a[i - 1] - ct
		l.append(x / i)
		ct += x / i
		if x % (2 * i) != 0 or x <= 0 or l[-1] == l[-2]:
			print('NO')
			break
	else:
		print('YES')


k = int(input())
for i in range(k):
	n = int(input())
	d = list(map(int, input().split()))
	demi_d = []
	resultat = 'YES'
	d.sort()
	for i in range(n):
		if d[2 * i] != d[2 * i + 1] or d[2 * i] % 2 != 0:
			resultat = 'NO'
			break
		else:
			demi_d.append(d[2 * i])
	if len(set(demi_d)) != n:
		resultat = 'NO'
	val = 0
	if resultat == 'YES':
		for j in range(n, 0, -1):
			val1 = demi_d[j - 1] / 2
			if (val1 - val) % j == 0 and val1 - val > 0:
				val = val + (val1 - val) / j
			else:
				resultat = 'NO'
				break
	print(resultat)


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

def go():
	(n,) = ints()
	a = ints()
	ans = solve(a, n)
	print('YES' if ans else 'NO')

def solve(a, n):
	a.sort(reverse=True)
	last = 10 ** 12
	s = 0
	for i in range(n):
		d = a[2 * i]
		if a[2 * i + 1] != d:
			return False
		if d % 2:
			return False
		rem = d // 2 - s
		if rem % (n - i):
			return False
		x = rem // (n - i)
		if x <= 0 or x == last:
			return False
		s += x
		last = x
	return True
(num_cases,) = ints()
for case_num in range(num_cases):
	go()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	d = {}
	for i in l:
		d[i] = d.get(i, 0) + 1
	f = 0
	for i in d:
		if d[i] != 2 or i % 2 == 1:
			f = 1
			break
	if f:
		print('NO')
		continue
	s = 0
	last = 10 ** 12
	t = []
	for i in d:
		t.append(i)
	t.sort()
	for i in t[::-1]:
		if (i - 2 * s) // (2 * n) != (i - 2 * s) / (2 * n):
			print('NO')
			f = 1
			break
		r = (i - 2 * s) // (2 * n)
		s += r
		n -= 1
		if r >= last or r <= 0:
			print('NO')
			f = 1
			break
		last = r
	if f == 0:
		print('YES')


def min_value(n):
	return n * (n + 1)

def solve():
	n = int(input())
	d = [int(s) for s in input().split()]
	broken = False
	d = sorted(d)
	if d[::2] == d[1::2]:
		d = sorted(d)[::2]
	else:
		broken = True
	total_difference = 0
	for i in range(1, n):
		difference = d[i] - d[i - 1]
		if difference % (2 * i) == 0 and difference > 0:
			total_difference += difference // (2 * i) * (n - i)
		else:
			broken = True
			break
	if not broken and (d[0] - 2 * total_difference) % (2 * n) == 0 and (d[0] - 2 * total_difference > 0):
		print('YES')
	else:
		print('NO')
t = int(input())
for test in range(t):
	solve()


def main():
	T = int(input())
	for ___ in range(T):
		n = input().strip()
		n = int(n)
		l1 = [int(_) for _ in input().strip().split()]
		l1 = list(reversed(sorted(l1)))
		succ = True
		cur_sum = 0
		cur = 0
		num_remain = 2 * n
		r = [int(1000000000000.0 + 7)]
		for i in range(0, 2 * n, 2):
			if l1[i] != l1[i + 1]:
				succ = False
				break
			cur = l1[i] - 2 * cur_sum
			if cur <= 0 or cur % num_remain != 0:
				succ = False
				break
			cur = cur // num_remain
			if cur >= r[-1]:
				succ = False
				break
			cur_sum += cur
			num_remain -= 2
			r.append(cur)
		if succ:
			print('YES')
		else:
			print('NO')
import os
import sys
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')
main()


def readInt():
	return int(input())

def readInts():
	return [int(x) for x in input().split()]

def readString():
	return input().rstrip()

def readCase():
	return readString()

def solve(n, array):
	array.sort()
	sub_total = 0
	elems = 0
	prev_e = 10 ** 20
	while array:
		(x, y) = (array.pop(), array.pop())
		if x != y:
			return 'NO'
		if (x - sub_total) % (n - elems) != 0:
			return 'NO'
		e = (x - sub_total) // (n - elems)
		if e <= 0 or e >= prev_e:
			return 'NO'
		sub_total += 2 * e
		elems += 2
		prev_e = e
	return 'YES'
cases = readInt()
for case in range(cases):
	n = readInt()
	array = readInts()
	print(solve(2 * n, array))


import collections
import string
import math
import copy
import os
import sys
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))

def input():
	return sys.stdin.readline().rstrip('\r\n')
mo = 998244353

def exgcd(a, b):
	if not b:
		return (1, 0)
	(y, x) = exgcd(b, a % b)
	y -= a // b * x
	return (x, y)

def getinv(a, m):
	(x, y) = exgcd(a, m)
	return --1 if x == 1 else x % m

def comb(n, b):
	res = 1
	b = min(b, n - b)
	for i in range(b):
		res = res * (n - i) * getinv(i + 1, mo) % mo
	return res % mo

def quickpower(a, n):
	res = 1
	while n:
		if n & 1:
			res = res * a % mo
		n >>= 1
		a = a * a % mo
	return res

def dis(a, b):
	return abs(a[0] - b[0]) + abs(a[1] - b[1])

def getpref(x):
	if x > 1:
		return x * (x - 1) >> 1
	else:
		return 0

def orafli(upp):
	primes = []
	marked = [False for i in range(upp + 3)]
	for i in range(2, upp):
		if not marked[i]:
			primes.append(i)
		for j in primes:
			if i * j >= upp:
				break
			marked[i * j] = True
			if i % j == 0:
				break
	return primes
t = int(input())
for ti in range(t):
	n = int(input())
	li = [int(i) for i in input().split()]
	s = set()
	ff = True
	for i in li:
		if i & 1:
			print('NO')
			ff = False
			break
		if i in s:
			s.discard(i)
		else:
			s.add(i)
	if ff == False:
		continue
	if s:
		print('NO')
		continue
	li.sort()
	pref = 0
	ori = []
	while li:
		li[-1] -= pref
		if li[-1] % len(li) == 0:
			if ori and ori[-1] == li[-1] // len(li):
				print('NO')
				ff = False
				break
			if li[-1] <= 0:
				print('NO')
				ff = False
				break
			ori.append(li[-1] // len(li))
			pref += li[-1] // len(li) * 2
			li.pop()
			li.pop()
		else:
			ff = False
			print('NO')
			break
	if not ff:
		continue
	if ori[-1] != 0:
		print('YES')
	else:
		print('NO')


import sys
import math
import random
from queue import PriorityQueue as PQ
from bisect import bisect_left as BSL
from bisect import bisect_right as BSR
from collections import OrderedDict as OD
from collections import Counter
from itertools import permutations
mod = 1000000007
MOD = mod
try:
	sys.stdin = open('actext.txt', 'r')
	OPENFILE = 1
except:
	pass

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

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

def check(i, n):
	if 0 <= i < n:
		return True
	else:
		return False
t = int(input())
for tt in range(t):
	n = int(input())
	arr = list(get_ints())
	mp = {}
	flg = 0
	for i in arr:
		if i not in mp:
			mp[i] = 0
		mp[i] += 1
	for (i, j) in mp.items():
		if j != 2 or i % 2 != 0:
			flg = 1
			break
	if flg == 0:
		arr.sort(reverse=True)
		presum = 0
		nn = n
		for i in arr[0::2]:
			if (i - presum) % (2 * nn) == 0:
				num = (i - presum) // (2 * nn)
				presum += num * 2
				nn -= 1
				if num <= 0:
					flg = 1
					break
			else:
				flg = 1
				break
	if flg == 1:
		print('NO')
	else:
		print('YES')


from sys import stdin, stdout
from math import gcd, sqrt, factorial, pi, inf
from collections import deque, defaultdict
from bisect import bisect, bisect_left
from itertools import permutations as per
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(str(x) + '\n')
nCr = lambda x, y: f[x] * inv(f[y] * f[x - y] % N) % N
inv = lambda x: pow(x, N - 2, N)
lcm = lambda x, y: x * y // gcd(x, y)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7
for _ in range(I()):
	n = I()
	flg = True
	p = 0
	a = sorted(R(), reverse=True)
	x = 0
	pst = -1
	v = []
	flag = False
	for i in range(n * 2):
		if a[i] != pst:
			x = 1
			v += (a[i],)
		else:
			x += 1
		if x > 2:
			flag = True
			print('NO')
			break
		pst = a[i]
	if flag:
		continue
	if len(v) != n:
		print('NO')
		continue
	for i in v:
		if i - p <= 0 or (i - p) % n or (i - p) % 2:
			flg = False
			break
		p += (i - p) // n
		n -= 1
	print('YES' if flg else 'NO')


import time, math as mt, bisect as bs, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

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

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

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

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

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

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

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def readTree(n, e):
	adj = [set() for i in range(n + 1)]
	for i in range(e):
		(u1, u2) = IP()
		adj[u1].add(u2)
	return adj

def sieve():
	li = [True] * (10 ** 3 + 5)
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	(prime, cur) = ([0] * 200, 0)
	for i in range(10 ** 3 + 5):
		if li[i] == True:
			prime[cur] = i
			cur += 1
	return prime

def SPF():
	mx = 10 ** 6 + 1
	spf[1] = 1
	for i in range(2, mx):
		if spf[i] == 1000000000.0:
			spf[i] = i
			for j in range(i * i, mx, i):
				if i < spf[j]:
					spf[j] = i
	return

def prime(n, d):
	prm = set()
	while n != 1:
		prm.add(spf[n])
		n = n // spf[n]
	for ele in prm:
		d[ele] = d.get(ele, 0) + 1
	return
mod = 998244353
inf = 10000000000000000

def solve():
	n = II()
	arr = L()
	arr.sort(reverse=True)
	for i in range(0, 2 * n, 2):
		if arr[i] != arr[i + 1]:
			print('NO')
			return
	d = []
	for i in range(0, 2 * n, 2):
		d.append(arr[i])
	num = 2 * n
	sub = 0
	mp = {}
	for i in range(n):
		val = d[i] - sub
		if val <= 0 or val % num:
			print('NO')
			return
		found = val // num
		if mp.get(found, 0) == 1:
			print('NO')
			return
		mp[found] = 1
		num -= 2
		sub += 2 * found
	print('YES')
	return
t = II()
for i in range(t):
	solve()


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	d = {}
	for i in arr:
		if i in d:
			d[i] += 1
		else:
			d[i] = 1
	f = 0
	for i in d:
		if i % 2 != 0 or d[i] % 2 != 0:
			f = 1
	if n == 1:
		if f == 0:
			print('YES')
		else:
			print('NO')
		continue
	arr.sort()
	val = []
	for i in range(0, 2 * n, 2):
		val.append(arr[i])
	fac = 2 * n
	pre = 0
	tot = 0
	ans = set()
	for i in range(n - 1, -1, -1):
		cnt = val[i]
		cnt -= tot * 2
		if cnt % fac == 0 and cnt >= 0:
			cnt = cnt // fac
			if cnt != 0:
				ans.add(cnt)
			tot += cnt
			fac -= 2
	if len(ans) == n and f == 0:
		print('YES')
	else:
		print('NO')


import sys
max_int = 2147483648
min_int = -max_int
t = int(input())
for _t in range(t):
	n = int(sys.stdin.readline())
	a = map(int, sys.stdin.readline().split())
	once = set()
	twice = set()
	has_to_break = False
	for aa in a:
		if aa % 2:
			has_to_break = True
			break
		if aa in once:
			if aa in twice:
				has_to_break = True
				break
			twice.add(aa)
		else:
			once.add(aa)
	if has_to_break or once != twice:
		print('NO')
		continue
	a = list(twice)
	a.sort(reverse=True)
	if a[0] % (2 * n):
		print('NO')
		continue
	x = a[0] // (2 * n)
	for i in range(n - 1):
		a1 = a[i]
		a2 = a[i + 1]
		if (a1 - a2) % (2 * n - 2 - 2 * i):
			print('NO')
			break
		x -= (a1 - a2) // (2 * n - 2 - 2 * i)
		if x <= 0:
			print('NO')
			break
	else:
		print('YES')


import sys
input = sys.stdin.readline

def solve(ds):
	n = len(ds)
	ds.sort(reverse=True)
	other_sum = 0
	for i in range(0, n, 2):
		if ds[i] != ds[i + 1] or (i < n - 2 and ds[i] == ds[i + 2]):
			print('NO')
			return
		a = (ds[i] - other_sum) / (n - i)
		if a != a // 1 or a <= 0:
			print('NO')
			return
		other_sum += 2 * a
	print('YES')
for _ in range(int(input())):
	n = int(input())
	ds = [int(x) for x in input().split()]
	solve(ds)


from collections import deque, Counter, defaultdict as dft
from heapq import heappop, heappush
from math import log, sqrt, factorial, cos, tan, sin, radians, log2, ceil, floor
from bisect import bisect, bisect_left, bisect_right
from decimal import *
import sys, threading
from itertools import permutations, combinations
from copy import deepcopy
input = sys.stdin.readline
ii = lambda : int(input())
si = lambda : input().rstrip()
mp = lambda : map(int, input().split())
ms = lambda : map(str, input().strip().split(' '))
ml = lambda : list(mp())
mf = lambda : map(float, input().split())

def solve():
	n = ii()
	arr = ml()
	dct = Counter(arr)
	ls = []
	for k in dct:
		if dct[k] != 2:
			print('NO')
			return
		else:
			ls.append(k)
	ls.sort()
	aage = 0
	f = n * 2
	vis = set()
	while ls:
		num = ls.pop()
		if (num - aage) % f != 0:
			print('NO')
			return
		else:
			temp = (num - aage) // f
			if temp <= 0 or temp in vis:
				print('NO')
				return
			vis.add(temp)
			aage += temp * 2
			f -= 2
	if len(vis) == n:
		print('YES')
	else:
		print('NO')
tc = ii()
for i in range(tc):
	solve()


from bisect import *
from collections import *
from math import gcd, ceil, sqrt, floor, inf
from heapq import *
from itertools import *
from functools import *
import os
import sys
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')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

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

def N():
	return int(input())
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc
mod = 10 ** 9 + 7
farr = [1]
ifa = []

def fact(x, mod=0):
	if mod:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr) % mod)
	else:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr))
	return farr[x]

def ifact(x, mod):
	global ifa
	fact(x, mod)
	ifa.append(pow(farr[-1], mod - 2, mod))
	for i in range(x, 0, -1):
		ifa.append(ifa[-1] * i % mod)
	ifa.reverse()

def per(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return fact(i) // fact(i - j)
	return farr[i] * ifa[i - j] % mod

def com(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return per(i, j) // fact(j)
	return per(i, j, mod) * ifa[j] % mod

def catalan(n):
	return com(2 * n, n) // (n + 1)

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

def floorsum(a, b, c, n):
	if a == 0:
		return b // c * (n + 1)
	if a >= c or b >= c:
		return floorsum(a % c, b % c, c, n) + b // c * (n + 1) + a // c * n * (n + 1) // 2
	m = (a * n + b) // c
	return n * m - floorsum(c, c - b - 1, a, m - 1)

def lowbit(n):
	return n & -n

def inverse(a, m):
	a %= m
	if a <= 1:
		return a
	return (1 - inverse(m, a) * m) // a % m

class BIT:

	def __init__(self, arr):
		self.arr = arr
		self.n = len(arr) - 1

	def update(self, x, v):
		while x <= self.n:
			self.arr[x] += v
			x += x & -x

	def query(self, x):
		ans = 0
		while x:
			ans += self.arr[x]
			x &= x - 1
		return ans

class DSU:

	def __init__(self, n):
		self.c = [-1] * n

	def same(self, x, y):
		return self.find(x) == self.find(y)

	def find(self, x):
		if self.c[x] < 0:
			return x
		self.c[x] = self.find(self.c[x])
		return self.c[x]

	def union(self, u, v):
		(u, v) = (self.find(u), self.find(v))
		if u == v:
			return False
		if self.c[u] > self.c[v]:
			(u, v) = (v, u)
		self.c[u] += self.c[v]
		self.c[v] = u
		return True

	def size(self, x):
		return -self.c[self.find(x)]

class UFS:

	def __init__(self, n):
		self.parent = [i for i in range(n)]
		self.ranks = [0] * n

	def find(self, x):
		if x != self.parent[x]:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def union(self, u, v):
		(pu, pv) = (self.find(u), self.find(v))
		if pu == pv:
			return False
		if self.ranks[pu] >= self.ranks[pv]:
			self.parent[pv] = pu
			if self.ranks[pv] == self.ranks[pu]:
				self.ranks[pu] += 1
		else:
			self.parent[pu] = pv

def Prime(n):
	c = 0
	prime = []
	flag = [0] * (n + 1)
	for i in range(2, n + 1):
		if not flag[i]:
			prime.append(i)
			c += 1
		for j in range(c):
			if i * prime[j] > n:
				break
			flag[i * prime[j]] = prime[j]
			if i % prime[j] == 0:
				break
	return prime

def dij(s, graph):
	d = {}
	d[s] = 0
	heap = [(0, s)]
	seen = set()
	while heap:
		(dis, u) = heappop(heap)
		if u in seen:
			continue
		seen.add(u)
		for (v, w) in graph[u]:
			if v not in d or d[v] > d[u] + w:
				d[v] = d[u] + w
				heappush(heap, (d[v], v))
	return d

def GP(it):
	return [[ch, len(list(g))] for (ch, g) in groupby(it)]

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

def lis(nums):
	res = []
	for k in nums:
		i = bisect.bisect_left(res, k)
		if i == len(res):
			res.append(k)
		else:
			res[i] = k
	return len(res)

class DLN:

	def __init__(self, val):
		self.val = val
		self.pre = None
		self.next = None

def nb(i, j):
	for (ni, nj) in [[i + 1, j], [i - 1, j], [i, j - 1], [i, j + 1]]:
		if 0 <= ni < n and 0 <= nj < m:
			yield (ni, nj)

def topo(n):
	q = deque()
	res = []
	for i in range(1, n + 1):
		if ind[i] == 0:
			q.append(i)
			res.append(i)
	while q:
		u = q.popleft()
		for v in g[u]:
			ind[v] -= 1
			if ind[v] == 0:
				q.append(v)
				res.append(v)
	return res

@bootstrap
def gdfs(r, p):
	if len(g[r]) == 1 and p != -1:
		yield None
	for ch in g[r]:
		if ch != p:
			yield gdfs(ch, r)
	yield None
t = N()
for i in range(t):
	n = N()
	d = RLL()
	c = Counter(d)
	if any((c[k] != 2 for k in c)) or any((k & 1 for k in c)):
		print('NO')
	else:
		a = sorted(c.keys())
		d = [0] * n
		f = True
		for i in range(n - 1):
			if (a[i + 1] - a[i]) % (2 * (i + 1)):
				f = False
				break
			d[i + 1] = (a[i + 1] - a[i]) // (2 * (i + 1)) + d[i]
		if f:
			s = sum(d)
			if a[0] <= 2 * s or (a[0] - 2 * s) % (2 * n):
				f = False
		if f:
			print('YES')
		else:
			print('NO')


from collections import Counter
N = int(input())

def solve(n, d):
	d = Counter(d)
	s = 0
	cnt = 0
	for x in sorted(d, reverse=True):
		if d[x] != 2:
			return 'NO'
		ai = x + 2 * s
		if ai % (2 * n - 2 * cnt) != 0:
			return 'NO'
		ai //= 2 * n - 2 * cnt
		ai *= -1
		if ai >= 0:
			return 'NO'
		s += ai
		cnt += 1
		if cnt == n:
			break
	return 'YES'
for _ in range(N):
	n = int(input())
	d = list(map(int, input().split()))
	print(solve(n, d))


answers = []

def solve(n, numbers):
	store = {}
	for ele in numbers:
		if ele % 2 == 1:
			answers.append('NO')
			return
		if ele not in store:
			store[ele] = 1
	if len(store) != n:
		answers.append('NO')
		return
	final = []
	for ele in store:
		final.append(ele)
	final.sort()
	elements = [None for i in final]
	mult = 2 * n
	if final[-1] % mult != 0:
		answers.append('NO')
		return
	else:
		elements[-1] = final[-1] // mult
	cumSum = 0
	for i in range(n - 2, -1, -1):
		mult = 2 * (i + 1)
		cumSum += elements[i + 1] * 2
		if (final[i] - cumSum) % mult != 0:
			answers.append('NO')
			return
		else:
			currentElement = (final[i] - cumSum) // mult
			elements[i] = currentElement
			if currentElement <= 0:
				answers.append('NO')
				return
	miniStore = {}
	for ele in elements:
		if ele == None:
			answers.append('NO')
			return
		if ele <= 0:
			answers.append('NO')
			return
		if ele not in miniStore:
			miniStore[ele] = 1
		else:
			answers.append('NO')
			return
	answers.append('YES')
T = int(input())
while T:
	N = int(input())
	numbers = [int(x) for x in input().split()]
	solve(N, numbers)
	T -= 1
for ans in answers:
	print(ans)


def main():
	import sys
	input = sys.stdin.buffer.readline
	from collections import Counter
	for _ in range(int(input())):
		n = int(input())
		d = list(map(int, input().split()))
		c = Counter(d)
		if any((v != 2 for (k, v) in c.items())):
			print('NO')
			continue
		d = sorted(list(set(d)), reverse=True)
		l = []
		if d[0] % (n * 2) != 0:
			print('NO')
			continue
		l.append(d[0] // (n * 2))
		for i in range(1, n):
			if (d[i - 1] - d[i]) % ((n - i) * 2) != 0:
				print('NO')
				break
			l.append(l[-1] - (d[i - 1] - d[i]) // ((n - i) * 2))
		else:
			for i in l:
				if i <= 0:
					print('NO')
					break
			else:
				print('YES')
main()


t = int(input())
for i in range(t):
	n = int(input())
	D = list(map(int, input().split()))
	possible = True
	freq = {}
	for d in D:
		if d == 0 or d % 2 == 1:
			possible = False
			break
		freq[d] = freq.get(d, 0) + 1
	if not possible:
		print('NO')
		continue
	for (d, f) in freq.items():
		if f != 2:
			possible = False
			break
	if not possible:
		print('NO')
		continue
	rSortedDistinctD = sorted(freq.keys(), reverse=True)
	currentASum = 0
	for j in range(n):
		d = rSortedDistinctD[j]
		a = (d - 2 * currentASum) / (2 * (n - j))
		if a < 1 or a != int(a):
			possible = False
			break
		currentASum += int(a)
	result = 'YES' if possible else 'NO'
	print(result)


import collections
T = int(input())
for t in range(T):
	n = int(input())
	dd = [int(x) for x in input().split()]
	dcount = collections.Counter(dd)
	if len(dcount) != n:
		print('NO')
	else:
		have_solution = True
		for (d, count) in dcount.items():
			if count != 2:
				have_solution = False
				break
		if have_solution:
			sorted_d = sorted(list(dcount.keys()), key=lambda x: -x)
			bb = []
			bb_sum = 0
			index = n
			for d in sorted_d:
				if (d - 2 * bb_sum) % (2 * index) == 0:
					next_b = (d - 2 * bb_sum) // (2 * index)
					bb_sum += next_b
					index -= 1
					if len(bb) > 0 and next_b >= bb[-1] or next_b <= 0:
						have_solution = False
						break
					bb.append(next_b)
				else:
					have_solution = False
					break
		if have_solution:
			print('YES')
		else:
			print('NO')


def work():
	d.sort(reverse=True)
	b = [0] * n
	c = [0] * n
	for i in range(n):
		if d[i * 2] != d[i * 2 + 1]:
			print('NO')
			return
		b[i] = d[i * 2]
	for i in range(1, n):
		if b[i] == b[i - 1] or (b[i - 1] - b[i]) % (2 * (n - i)):
			print('NO')
			return
		c[i] = (b[i - 1] - b[i]) // (2 * (n - i))
	for i in range(1, n):
		b[n - 1] -= 2 * i * c[i]
	if b[n - 1] <= 0 or b[n - 1] % (2 * n):
		print('NO')
	else:
		print('YES')
t = int(input())
for _ in range(t):
	n = int(input())
	d = [int(x.strip()) for x in input().split()]
	work()


def ss(n, l):
	d = {}
	for i in l:
		if i % 2 == 1:
			return 'NO'
		if i in d:
			d[i] += 1
		else:
			d[i] = 1
	for i in d:
		if d[i] != 2:
			return 'NO'
	t = []
	for i in d:
		t.append(i)
	t = sorted(t)[::-1]
	n = len(t)
	x = 0
	for i in range(n):
		y = t[i] - x
		if y <= 0:
			return 'NO'
		if y % (2 * (n - i)) == 0:
			x += 2 * y // (2 * (n - i))
		else:
			return 'NO'
	return 'YES'
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	print(ss(n, l))


t = int(input())

def get_answer(v):
	l = len(v) // 2
	v.sort()
	i = l - 1
	s = 0
	while i >= 0:
		if v[i * 2] != v[i * 2 + 1] or v[i * 2] % 2 != 0:
			return False
		elif (v[i * 2] // 2 - s) % (i + 1) != 0:
			return False
		else:
			a = (v[i * 2] // 2 - s) // (i + 1)
			if a <= 0:
				return False
			if l > 1 and i <= l - 1 and (v[i * 2 + 1] == v[i * 2 - 1]):
				return False
			s = s + a
		i -= 1
	return True
for _ in range(t):
	n = int(input())
	v = list(map(int, input().split()))
	if get_answer(v):
		print('YES')
	else:
		print('NO')


import math
YES = 'YES'
NO = 'NO'
MOD = 1000000007

def input_int():
	return int(input())

def input_list():
	return input().split(' ')

def input_list_int():
	return list(map(int, input_list()))

def solve():
	n = input_int()
	a = input_list_int()
	m = []
	cmp = {}
	for i in range(0, 2 * n):
		if a[i] not in cmp:
			cmp[a[i]] = 0
		cmp[a[i]] += 1
		if cmp[a[i]] == 2:
			del cmp[a[i]]
			m.append(a[i])
	if len(cmp) > 0:
		print(NO)
	else:
		m.sort(reverse=True)
		delim = 2 * n
		last = 0
		x = []
		for i in range(0, n):
			m[i] -= last
			mul = m[i] / delim
			last += 2 * mul
			x.append(mul)
			delim -= 2
		x.sort()
		has = 1
		for i in range(0, n):
			if x[i] <= 0 or int(x[i]) != x[i]:
				has = 0
			if i > 0 and x[i] == x[i - 1]:
				has = 0
		print(YES if has == 1 else NO)
query_count = input_int()
while query_count:
	query_count -= 1
	solve()


import sys

def fn(n, d):
	d.sort(reverse=True)
	x = []
	y = []
	for i in d:
		if i % 2 != 0:
			print('NO')
			return 0
	for i in range(2 * n):
		if i % 2 == 0:
			x.append(d[i])
		else:
			y.append(d[i])
	if x != y:
		print('NO')
		return 0
	flag = 0
	h = 0
	for i in range(n):
		if i < n - 1 and x[i] == x[i + 1]:
			print('NO')
			return 0
		if (x[i] - h) % (2 * n - 2 * i) == 0 and x[i] - h > 0:
			flag = 1
			h = h + 2 * (x[i] - h) // (2 * n - 2 * i)
		else:
			print('NO')
			return 0
	if flag == 1:
		print('YES')
		return 1
input = sys.stdin.read()
data = list(map(int, input.split()))
t = data[0]
l = 0
for i in range(t):
	n = data[l + 1]
	d = data[l + 2:l + 2 * n + 2]
	l = l + 1 + n * 2
	fn(n, d)


import sys

def get_ints():
	return list(map(int, sys.stdin.readline().strip().split()))
t = int(input())
for _ in range(t):
	n = int(input())
	a = get_ints()
	q = set(a)
	if len(q) != n:
		print('NO')
	else:
		a = list(q)
		a = sorted(a)
		s = 0
		f = 1
		for i in range(n - 1, -1, -1):
			j = i + 1
			if (a[i] - 2 * s) % (2 * j) != 0 or a[i] - 2 * s <= 0:
				f = 0
				break
			else:
				s = s + (a[i] - 2 * s) // (2 * j)
		if f:
			print('YES')
		else:
			print('NO')


from collections import Counter

def solve(D, n):
	dic = Counter()
	D.sort()
	for it in D:
		dic[abs(it)] += 1
	c = 0
	for (k, v) in dic.items():
		if v != 2:
			return 'NO'
		c += 1
	if c != n:
		return 'NO'
	D = D[::2]
	diff = [D[i + 1] - D[i] for i in range(n - 1)]
	d = []
	mul = 2
	b1 = 0
	for it in diff:
		if it % mul != 0:
			return 'NO'
		d.append(it // mul)
		b1 += (n - len(d)) * d[-1]
		mul += 2
	if D[0] % 2:
		return 'NO'
	a = D[0] // 2 - b1
	if a % n:
		return 'NO'
	a = a // n
	if a <= 0:
		return 'NO'
	for it in d:
		a += it
		if a == 0 or it == 0:
			return 'NO'
	return 'YES'
for case in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	ans = solve(arr, n)
	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 exact(num):
	if abs(num - round(num)) <= 10 ** (-9):
		return round(num)
	return num

def solve(n, lst):
	lst = list(set(lst))
	if len(lst) > n:
		return 'NO'
	for i in lst:
		if i % 2:
			return 'NO'
	lst = sorted(lst)
	for i in range(len(lst)):
		lst[i] //= 2
	maxx = lst[-1] / n
	ans = [maxx]
	summ = maxx
	for i in range(n - 2, -1, -1):
		val = lst[i] - summ
		if val % (i + 1):
			return 'NO'
		if val < 0:
			return 'NO'
		if val == 0:
			return 'NO'
		val //= i + 1
		ans.append(val)
		summ += val
	if len(set(ans)) != len(ans) or 0 in ans:
		return 'NO'
	return 'YES'
for _ in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	print(solve(n, lst))


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter
from itertools import permutations, combinations

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

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write('\n'.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
from decimal import Decimal
sys.setrecursionlimit(100000)
INF = float('inf')
mod = 998244353
for t in range(int(data())):
	n = int(data())
	d = mdata()
	l = list(set(d))
	if len(l) != n:
		out('NO')
		continue
	l.sort()
	ans = 'YES'
	k = 0
	s = set()
	for i in range(n - 1, -1, -1):
		if (l[i] - k) % (2 * (i + 1)) != 0:
			ans = 'NO'
			break
		s.add((l[i] - k) // (2 * (i + 1)))
		k += 2 * ((l[i] - k) // (2 * (i + 1)))
	if len(s) != n or min(s) < 1:
		ans = 'NO'
	out(ans)


import os
import sys
from io import BytesIO, IOBase
import threading
from bisect import bisect_left
from math import gcd, log
from collections import Counter
from pprint import pprint

def hasd(x, d):
	if x < 0:
		return False
	while x:
		if x % 10 == d:
			return True
		x //= 10
	return False

def main():
	n = int(input())
	arr = list(set(map(int, input().split())))
	if len(arr) != n:
		print('NO')
		return
	arr.sort()
	arr.reverse()
	psum = 0
	st = set()
	for i in range(n):
		mx = arr[i]
		if mx - 2 * psum <= 0:
			print('NO')
			return
		if (mx - 2 * psum) % (2 * (n - i)):
			print('NO')
			return
		st.add((mx - 2 * psum) // (2 * (n - i)))
		st.add(-(mx - 2 * psum) // (2 * (n - i)))
		psum = psum + (mx - 2 * psum) // (2 * (n - i))
	if len(st) != 2 * n:
		print('NO')
		return
	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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	main()


def solve(n, arr):
	m = 2 * n
	arr.sort(reverse=True)
	for i in range(0, m, 2):
		if arr[i] != arr[i + 1]:
			return False
	for i in range(1, m - 1, 2):
		if arr[i] == arr[i + 1]:
			return False
	s = 0
	for i in range(0, n):
		x = arr[2 * i] - 2 * s
		if x <= 0 or x % ((n - i) * 2):
			return False
		s += x // ((n - i) * 2)
	return True
import sys
input = lambda : sys.stdin.readline().rstrip()
t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	if solve(n, arr):
		print('YES')
	else:
		print('NO')


import os
import sys
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')
from math import gcd, ceil

def prod(a, mod=10 ** 9 + 7):
	ans = 1
	for each in a:
		ans = ans * each % mod
	return ans

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

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if True else 1):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	c = [a[i] for i in range(1, len(a), 2)][::-1]
	a = [a[i] for i in range(0, len(a), 2)][::-1]
	if c != a:
		print('NO')
		continue
	total = 0
	pos = True
	b = []
	for i in range(len(a)):
		if (a[i] - total) % (2 * (n - i)):
			pos = False
			break
		b += [(a[i] - total) // (2 * (n - i))]
		total += 2 * ((a[i] - total) // (2 * (n - i)))
	print('YES' if pos and len(b) == len(set(b)) and (min(b) > 0) else 'NO')


for _ in range(int(input())):
	n = int(input())
	s = [int(i) for i in input().split()]
	s.sort(reverse=True)
	s1 = 0
	b1 = True
	s2 = 2 * n
	i = 0
	while i != s2:
		if (s[i] - 2 * s1) % 2 != 0 or s[i] - 2 * s1 <= 0 or s[i] != s[i + 1]:
			b1 = False
			break
		elif (s[i] - 2 * s1) % (2 * n - i) == 0:
			s1 += (s[i] - 2 * s1) // (2 * n - i)
		else:
			b1 = False
			break
		if i != 0:
			if s[i] == s[i - 2]:
				b1 = False
				break
		i += 2
	if b1:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	(n, chk, s) = (int(input()), True, 0)
	arr = sorted(list(map(int, input().split())))
	for i in range(2 * n - 1, -1, -2):
		if arr[i] != arr[i - 1] or (i + 2 < 2 * n and arr[i] == arr[i + 2]) or arr[i] - s <= 0 or ((arr[i] - s) % (i + 1) != 0):
			chk = False
			print('NO')
			break
		s += 2 * (arr[i] - s) // (i + 1)
	if chk:
		print('YES')


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
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 main():
	t = int(input())
	for i in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		d = collections.Counter(a)
		f = True
		for k in d.keys():
			if d[k] != 2:
				f = False
				break
		if not f:
			print('NO')
			continue
		s = []
		for k in d.keys():
			if k >= 0:
				s.append(k)
		s.sort()
		tmp = 0
		for j in range(n - 1, -1, -1):
			k = 2 * (j + 1)
			if j == n - 1:
				if s[j] % k != 0:
					f = False
					break
				tmp += 2 * (s[j] // k)
			else:
				v = s[j] - tmp
				if v <= 0 or v % k != 0:
					f = False
					break
				tmp += 2 * (v // k)
		if not f:
			print('NO')
		else:
			print('YES')
main()


import sys
input = sys.stdin.readline
getint = lambda : int(input())
getints = lambda : [int(a) for a in input().split()]

def solve():
	n = getint()
	d = getints()
	d.sort()
	dd = [0 for i in range(n)]
	for i in range(n):
		if d[i * 2] % 2 != 0 or d[i * 2] != d[i * 2 + 1]:
			print('NO')
			return
		dd[i] = d[i * 2] // 2
	diff = [0 for i in range(n - 1)]
	for i in range(1, n):
		if (dd[i] - dd[i - 1]) % i != 0:
			print('NO')
			return
		diff[i - 1] = (dd[i] - dd[i - 1]) // i
		if diff[i - 1] == 0:
			print('NO')
			return
	sum = 0
	for i in range(n - 1):
		sum += diff[-i - 1] * (i + 1)
	mult = dd[0] - sum
	if mult <= 0 or mult % n != 0:
		print('NO')
		return
	print('YES')
t = getint()
for i in range(t):
	solve()


for _ in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	lst.sort(reverse=True)
	s = []
	flag = 0
	for i in range(0, 2 * n, 2):
		if lst[i] != lst[i + 1]:
			print('NO')
			flag = 1
			break
		s.append(lst[i])
	tmp = 2 * n
	cnt = 0
	pp = []
	if flag == 0:
		for i in s:
			ans = i - 2 * cnt
			ccc = ans / tmp
			if ccc % 1 != 0 or ccc == 0 or ccc < 0:
				print('NO')
				flag = 1
				break
			tmp -= 2
			cnt += ccc
			pp.append(ccc)
	if flag == 0:
		aaa = []
		for i in pp:
			aaa.append(i)
		aaa.sort(reverse=True)
		tt = set(pp)
		if aaa == pp and len(tt) == len(pp) and (len(tt) == n):
			print('YES')
		else:
			print('NO')


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	diff = [int(x) for x in input().split()]
	a = []
	diff.sort()
	diff = diff[::-1]
	flag = False
	for i in range(0, 2 * n, 2):
		if diff[i] != diff[i + 1]:
			print('NO')
			flag = True
			break
	if flag:
		continue
	temp = 0
	diff = [diff[x] for x in range(0, 2 * n, 2)]
	for i in range(n):
		if i > 0:
			if diff[i] == diff[i - 1]:
				flag = True
				break
		if temp >= diff[i]:
			flag = True
			break
		if (diff[i] - temp) % (2 * (n - i)) > 0:
			flag = True
			break
		temp1 = (diff[i] - temp) / (2 * (n - i))
		a.append(temp1)
		temp += 2 * temp1
	if flag:
		print('NO')
	else:
		print('YES')


t = int(input())
while t:
	n = int(input())
	my_in = list(map(int, input().split()))
	d = {}
	s = []
	ok = True
	for x in my_in:
		h = d.get(x)
		if h is None:
			d[x] = 1
			s.append(x)
		elif h == 1:
			d[x] = 2
		else:
			ok = False
			break
	if len(s) != n or not ok:
		print('NO')
		t -= 1
		continue
	s = sorted(s, reverse=True)
	a = 0
	flag = True
	for x in s:
		x -= a
		if x > 0 and x % (2 * n) == 0:
			a += x // n
			n -= 1
		else:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')
	t -= 1


import sys
import bisect as bi
import math
from collections import defaultdict as dd
from types import GeneratorType
input = sys.stdin.readline
mo = 10 ** 9 + 7

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input().strip()

def inin():
	return int(input())

def msb(n):
	n |= n >> 1
	n |= n >> 2
	n |= n >> 4
	n |= n >> 8
	n |= n >> 16
	n |= n >> 32
	n |= n >> 64
	return n - (n >> 1)

def pref(a, n, f):
	pre = [0] * n
	if f == 0:
		pre[0] = a[0]
		for i in range(1, n):
			pre[i] = a[i] + pre[i - 1]
	else:
		pre[-1] = a[-1]
		for i in range(n - 2, -1, -1):
			pre[i] = pre[i + 1] + a[i]
	return pre
for _ in range(inin()):
	n = inin()
	a = ain()
	flag = 1
	d = dd(int)
	if n == 1:
		if a.count(a[0]) == 2 and a[0] % 2 == 0:
			print('YES')
		else:
			print('NO')
	else:
		for i in a:
			if i % 2:
				flag = 0
			d[i] += 1
		if min(d.values()) < 2 or max(d.values()) > 2 or flag == 0:
			print('NO')
		else:
			l = sorted(list(d.keys()))
			if l[-1] % (2 * n) == 0:
				ans = [l[-1] // (2 * n)]
				prevans = ans[-1]
				prevvalue = l[-1]
				for i in range(n - 2, -1, -1):
					diff = prevvalue - l[i]
					num = 2 * (i + 1) * prevans - diff
					if num % (2 * (i + 1)) == 0:
						cur = num // (2 * (i + 1))
						ans += [cur]
						prevvalue = l[i]
						prevans = cur
					else:
						flag = 0
						break
				if flag:
					co = dd(int)
					for i in ans:
						if i <= 0:
							flag = 0
							break
						co[i] += 1
						if co[i] > 1:
							flag = 0
							break
				if flag:
					if sorted(ans, reverse=True) != ans:
						flag = 0
			else:
				flag = 0
			if flag:
				print('YES')
			else:
				print('NO')

def msb(n):
	n |= n >> 1
	n |= n >> 2
	n |= n >> 4
	n |= n >> 8
	n |= n >> 16
	n |= n >> 32
	n |= n >> 64
	return n - (n >> 1)

def pref(a, n, f):
	pre = [0] * n
	if f == 0:
		pre[0] = a[0]
		for i in range(1, n):
			pre[i] = a[i] + pre[i - 1]
	else:
		pre[-1] = a[-1]
		for i in range(n - 2, -1, -1):
			pre[i] = pre[i + 1] + a[i]
	return pre

def kadane(A):
	maxSoFar = maxEndingHere = start = end = beg = 0
	for i in range(len(A)):
		maxEndingHere = maxEndingHere + A[i]
		if maxEndingHere < 0:
			maxEndingHere = 0
			beg = i + 1
		if maxSoFar < maxEndingHere:
			maxSoFar = maxEndingHere
			start = beg
			end = i
	return (maxSoFar, start, end)

def modFact(n, p):
	if n < 0:
		return 0
	if n >= p:
		return 0
	result = 1
	for i in range(1, n + 1):
		result = result * i % p
	return result

def ncr(n, r, p):
	if n < r or n < 0:
		return 0
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc


import sys, os, io
import math, bisect, operator
(inf, mod) = (float('inf'), 10 ** 9 + 7)
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, defaultdict
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
Neo = lambda : list(map(int, input().split()))
(test,) = Neo()
for _ in range(test):
	(n,) = Neo()
	A = Neo()
	c = 0
	N = defaultdict(int)
	for i in range(2 * n):
		if A[i] % 2 == 1:
			c += 1
		N[A[i]] += 1
	f = 0
	for i in range(2 * n):
		if N[A[i]] != 2:
			f = 1
			break
	if f == 1 or c > 0:
		print('NO')
	else:
		B = [0] * (n + 1)
		A.sort(reverse=True)
		j = 0
		for i in range(0, 2 * n, 2):
			B[j] = A[i]
			j += 1
		sum = 0
		x = 2 * n
		for i in range(n):
			if B[i] - sum <= 0:
				f = 1
				break
			elif (B[i] - sum) % x == 0:
				z = (B[i] - sum) // x
				sum += 2 * z
				x -= 2
			else:
				f = 1
				break
		if f == 0:
			print('YES')
		else:
			print('NO')


import sys
pin = sys.stdin.readline
for T in range(int(pin())):
	N = int(pin())
	A = [*map(int, pin().split())]
	A.sort()
	if len(set(A)) != N:
		print('NO')
		continue
	A = A[::2]
	f = 1
	for a in A:
		if a % 2 != 0:
			f = 0
			break
	if not f:
		print('NO')
		continue
	A = [a // 2 for a in A][::-1]
	S = 0
	f = 1
	for n in range(N):
		if (A[n] - S) % (N - n) != 0:
			f = 0
			break
		elif A[n] <= S:
			f = 0
			break
		S += (A[n] - S) // (N - n)
	if not f:
		print('NO')
		continue
	print('YES')


import sys
input = sys.stdin.readline

def fans(n, A):
	B = []
	for i in range(0, 2 * n, 2):
		if A[i] != A[i + 1]:
			return 0
		if A[i] % 2 != 0:
			return 0
		B.append(A[i])
	(x, y) = (2 * n, 2)
	sm = 0
	G = {}
	for i in range(n):
		val = B[i] - y * sm
		if val % x == 0:
			v = val // x
			sm = sm + v
			if v <= 0:
				return 0
			if v in G:
				return 0
			G[v] = 1
			x = x - 2
		else:
			return 0
	return 1
T = int(input())
for _ in range(T):
	n = int(input())
	A = list(map(int, input().split()))
	A.sort(reverse=True)
	val = fans(n, A)
	if val == 1:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	d = sorted(map(int, input().split()), reverse=True)
	flag = True
	before = d[0]
	for i in range(0, 2 * n, 2):
		if i == 0:
			before = d[i]
		elif before == d[i]:
			flag = False
			break
		else:
			before = d[i]
		if d[i] != d[i + 1]:
			flag = False
			break
	if flag:
		temp = 0
		for i in range(0, 2 * n, 2):
			if not (d[i] - temp) % (2 * n) == 0:
				flag = False
				break
			elif d[i] <= temp:
				flag = False
				break
			else:
				temp += 2 * ((d[i] - temp) // (2 * n))
				n -= 1
	if flag:
		print('YES')
	else:
		print('NO')


import sys
for _ in range(int(input())):
	n = int(input())
	l1 = list(map(int, input().split()))
	l = list(set(l1))
	l.sort(reverse=True)
	a = []
	ans = 0
	if len(l) == n:
		for i in range(n):
			x = (l[i] - 2 * ans) / (2 * (n - i))
			ans += x
			a.append(x)
			if x % 1 != 0 or x < 1:
				print('NO')
				break
		else:
			print('YES')
	else:
		print('NO')


def solve():
	n = int(input())
	M = dict()
	V = list()
	for i in map(int, input().split()):
		if not i in M:
			M[i] = 0
			V.append(i)
		M[i] += 1
	V.sort(reverse=True)
	for (i, j) in M.items():
		if j != 2 or i % 2 != 0:
			print('NO')
			return
	A = list()
	for i in range(n - 1):
		if (V[i] - V[i + 1]) % ((n - 1 - i) * 2) != 0:
			print('NO')
			return
		else:
			A.append((V[i] - V[i + 1]) / ((n - 1 - i) * 2))
	for i in A:
		if i == 0:
			print('NO')
			return
	wow = V[-1]
	for i in range(len(A)):
		if wow < A[i] * (2 * (i + 1)):
			print('NO')
			return
		wow -= A[i] * (2 * (i + 1))
	if wow % (1 * (n * 2)) != 0 or wow == 0:
		print('NO')
		return
	print('YES')
	return

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


rn = lambda : int(input())
rl = lambda : list(map(int, input().split()))
rns = lambda : map(int, input().split())
rs = lambda : input()
yn = lambda x: print('Yes') if x else print('No')
YN = lambda x: print('YES') if x else print('NO')
for _ in range(rn()):
	n = rn()
	d = rl()
	dic = {}
	for i in d:
		if i in dic:
			dic[i] += 1
		else:
			dic[i] = 1
	ans = True
	for i in dic:
		if dic[i] != 2:
			ans = False
			break
	if not ans:
		print('NO')
	else:
		l = sorted(list(dic.keys()), reverse=True)
		pre = 0
		if l[0] % (2 * n) != 0:
			ans = False
		pre += l[0] // (2 * n)
		last = l[0] // (2 * n)
		lasts = [last]
		for i in range(1, n):
			if (l[i] - 2 * pre) % (2 * n - 2 * i) == 0 and 0 < (l[i] - 2 * pre) // (2 * n - 2 * i) <= last:
				last = (l[i] - 2 * pre) // (2 * n - 2 * i)
				lasts.append(last)
				pre += (l[i] - 2 * pre) // (2 * n - 2 * i)
			else:
				ans = False
				break
		YN(ans)


import sys
input = sys.stdin.readline
t = int(input())
for f in range(t):
	n = int(input())
	d = list(map(int, input().split()))
	s = set(d)
	flg_a = 0
	for i in d:
		if i % 2 == 1:
			flg_a = 1
			break
	if flg_a:
		print('NO')
	elif len(s) != n:
		print('NO')
	else:
		d = list(s)
		d.sort()
		flg = 'YES'
		if d[-1] % (2 * n) != 0:
			flg = 'NO'
		edge = d[-1] // (2 * n)
		chance = edge - n
		diff = []
		for i in range(n - 1):
			diff.append(d[i + 1] - d[i] - 2 * (i + 1))
		for i in range(len(diff)):
			if diff[i] != 0:
				if diff[i] % (2 * (i + 1)) != 0:
					flg = 'NO'
					break
				else:
					chance -= diff[i] // (2 * (i + 1))
		if chance < 0:
			flg = 'NO'
		print(flg)


import sys
from types import TracebackType
input = sys.stdin.readline
from collections import Counter

def main():
	for _ in range(int(input())):
		n = int(input())
		d = [int(j) for j in input().split()]
		d.sort(reverse=True)
		a = [0 for i in range(n)]
		sa = 0
		flag = 0
		for i in range(0, 2 * n, 2):
			if (d[i] - sa) % (2 * n - i) == 0 and d[i] == d[i + 1]:
				a[i // 2] = (d[i] - sa) // (2 * n - i)
				sa = 2 * a[i // 2] + sa
				if a[i // 2] <= 0:
					flag = 1
					break
			else:
				flag = 1
				break
		if flag == 1 or len(set(a)) < n:
			print('NO')
		else:
			print('YES')
main()


import sys
inf = sys.stdin
input = inf.readline

def read_one_int():
	return int(input().rstrip('\n'))

def read_list_of_ints():
	res = [int(val) for val in input().rstrip('\n').split(' ')]
	return res
from itertools import permutations

def check_seq(n, seq):
	res = ''
	check_dict = {}
	for el in seq:
		if el not in check_dict:
			check_dict[el] = 1
		else:
			check_dict[el] += 1
	for (_, counts) in check_dict.items():
		if counts != 2:
			res += 'NO\n'
			return res
	seq = list(set(seq))
	seq.sort(reverse=True)
	a_m = seq[0] / (2 * n)
	if seq[0] % (2 * n) or a_m <= 0:
		res += 'NO\n'
		return res
	a_list = [a_m]
	sum_2 = 0
	for i in range(1, n):
		sum_2 += a_list[-1] * 2
		cur_a = (seq[i] - sum_2) / (2 * n - 2 * i)
		if (seq[i] - sum_2) % (2 * n - 2 * i) or cur_a <= 0:
			res += 'NO\n'
			return res
		a_list.append(cur_a)
	res += 'YES\n'
	return res

def main():
	samples = read_one_int()
	res = ''
	for _ in range(samples):
		n = read_one_int()
		cur_seq = read_list_of_ints()
		res += check_seq(n, cur_seq)
	print(res[:-1])
main()