Sammy and Simmy love candies and frequently visit the local candy shop. Sammy and Simmy have bought $N$ candy packs. Packet $i$ contains $A_{i}$ candies. Sammy being the elder one is happy only if she has strictly more candies than Simmy. However Simmy, the more sensible one, is happy only if the difference between their number of candies is not more than $1$.

The shopkeeper, being a generous lady, agrees to help Sammy and Simmy by distributing the candies among them in a way that makes both of them happy. The shopkeeper can open the packs and distribute the candies even within a single pack to different people.

------ Input: ------
The first line will contain $T$, the number of testcases.
The first line of every test case will contain $N$, the number of candy packs.
The next line has $N$ integers, the $i_{th}$ integer denoting $A_{i}$, 
the number of candies in the $i_{th}$ pack.

------ Output: ------
Output "YES" if its possible for the shopkeeper to make both the sisters happy otherwise output "NO".  

------ Constraints  ------
$1 ≤ T ≤ 10^{3}$
$1 ≤ N ≤ 10^{3}$
$1 ≤ A_{i} ≤ 100$

----- Sample Input 1 ------ 
1  
2  
5 2
----- Sample Output 1 ------ 
YES
----- explanation 1 ------ 
Sammy gets 4 candies from the first pack.

Simmy gets 1 candy from the first pack and 2 from the second one.

So in total, Sammy has 4, and Simmy has 3. Since Sammy has strictly more candies than Simmy, Sammy is happy. And since the difference is not more then 1, Simmy is also happy. Thus both of them are happy.

Difficulty: EASY
Tags: Mathematics

Starter code:

Solutions:
for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if sum(a) % 2 == 0:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	x = int(input())
	l = list(map(int, input().split()))
	if sum(l) % 2 == 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	packs = int(input())
	lst = list(map(int, input().split()))
	sums = sum(lst)
	if sums % 2 == 1:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	x = list(map(int, input().split()))
	res = sum(x)
	if res % 2 == 0:
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	n = int(input())
	total = 0
	A = [int(n) for n in input().split()]
	for x in A:
		total += x
	if total % 2 == 1:
		print('YES')
	else:
		print('NO')


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


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	s = 0
	for i in range(0, n):
		s = s + a[i]
	if s % 2 == 1:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	sum1 = sum(l)
	if sum1 % 2 == 0:
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	c = 0
	for i in range(n):
		c += l[i]
	if c % 2 == 0:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = 0
	for i in a:
		b += i
	if b % 2 == 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	n1 = int(input())
	l1 = list(map(int, input().strip().split()))[:n1]
	if sum(l1) % 2 == 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	L = input().split()
	l = [eval(i) for i in L]
	if sum(l) % 2 == 0:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	s = sum(arr)
	if s % 2 == 0:
		print('NO')
	else:
		print('YES')


cases = int(input())
for case in range(cases):
	candy_packs = int(input())
	candies = sum(map(int, input().split()))
	if candies % 2 == 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	x = int(input())
	a = list(map(int, input().split()))
	if sum(a) % 2 == 1:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	packets = int(input())
	candies = list(map(int, input().split()))
	if sum(candies) % 2 == 1:
		print('YES')
		pass
	else:
		print('NO')
		pass
	pass


T = int(input())
for p in range(T):
	N = int(input())
	sum = 0
	arr = list(map(int, input().split()))
	for u in arr:
		sum += u
	if sum % 2 != 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(0, n):
	s = int(input())
	k = [int(x) for x in input().split()]
	total = 0
	for j in range(0, s):
		total = total + k[j]
	if total % 2 == 0:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	n = int(input())
	li = list(map(int, input().split()))
	if sum(li) % 2 == 1:
		print('YES')
	else:
		print('NO')


T = int(input())
for t in range(T):
	a = int(input())
	x = list(map(int, input().split()))
	y = sum(x)
	if y % 2 == 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	k = int(input())
	l = list(map(int, input().split()))
	m = sum(l)
	if m % 2 == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	if sum(a) % 2 == 1:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	n = int(input())
	l = list(map(int, input().split(' ')))
	r = sum(l)
	if r % 2:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	inp = int(input())
	arr1 = [int(x) for x in input().split()]
	sum1 = 0
	for y in arr1:
		sum1 += y
	if sum1 % 2 == 0:
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	x = int(input())
	v = list(map(int, input().split()))
	c = sum(v)
	if (c - 1) % 2 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	n = int(input())
	l = list(map(int, input().split()))
	if sum(l) % 2 == 1:
		print('YES')
	else:
		print('NO')
	t -= 1


try:
	for _ in range(int(input())):
		N = int(input())
		L = sum(list(map(int, input().split())))
		print('YES' if L % 2 else 'NO')
except:
	pass


q = int(input())
while q > 0:
	n = int(input())
	l = list(map(int, input().split()))
	s = sum(l)
	if s % 2 != 0:
		print('YES')
	else:
		print('NO')
	q = q - 1


goals = int(input())
for distractions in range(goals):
	wife = int(input())
	life = list(map(int, input().split()))
	if sum(life) % 2 == 1:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if sum(a) % 2 == 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	N = int(input())
	A = list(map(int, input().split()))
	if sum(A) % 2 == 0:
		print('NO')
	else:
		print('YES')