You are given some Tetris field consisting of $n$ columns. The initial height of the $i$-th column of the field is $a_i$ blocks. On top of these columns you can place only figures of size $2 \times 1$ (i.e. the height of this figure is $2$ blocks and the width of this figure is $1$ block). Note that you cannot rotate these figures.

Your task is to say if you can clear the whole field by placing such figures.

More formally, the problem can be described like this:

The following process occurs while at least one $a_i$ is greater than $0$:  You place one figure $2 \times 1$ (choose some $i$ from $1$ to $n$ and replace $a_i$ with $a_i + 2$);  then, while all $a_i$ are greater than zero, replace each $a_i$ with $a_i - 1$. 

And your task is to determine if it is possible to clear the whole field (i.e. finish the described process), choosing the places for new figures properly.

You have to answer $t$ independent test cases.


-----Input-----

The first line of the input contains one integer $t$ ($1 \le t \le 100$) — the number of test cases.

The next $2t$ lines describe test cases. The first line of the test case contains one integer $n$ ($1 \le n \le 100$) — the number of columns in the Tetris field. The second line of the test case contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 100$), where $a_i$ is the initial height of the $i$-th column of the Tetris field.


-----Output-----

For each test case, print the answer — "YES" (without quotes) if you can clear the whole Tetris field and "NO" otherwise.


-----Example-----
Input
4
3
1 1 3
4
1 1 2 1
2
11 11
1
100

Output
YES
NO
YES
YES



-----Note-----

The first test case of the example field is shown below:

[Image]

Gray lines are bounds of the Tetris field. Note that the field has no upper bound.

One of the correct answers is to first place the figure in the first column. Then after the second step of the process, the field becomes $[2, 0, 2]$. Then place the figure in the second column and after the second step of the process, the field becomes $[0, 0, 0]$.

And the second test case of the example field is shown below:

$\square$

It can be shown that you cannot do anything to end the process.

In the third test case of the example, you first place the figure in the second column after the second step of the process, the field becomes $[0, 2]$. Then place the figure in the first column and after the second step of the process, the field becomes $[0, 0]$.

In the fourth test case of the example, place the figure in the first column, then the field becomes $[102]$ after the first step of the process, and then the field becomes $[0]$ after the second step of the process.

Difficulty: introductory

Starter code:

Solutions:
t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(j) for j in input().split()]
	flag = 0
	for x in arr:
		if x%2 != arr[0]%2:
			flag = 1
			break
	if flag == 1:
		print("NO")
	else:
		print("YES")

q = int(input())
for rwe in range(q):
	n = int(input())
	l = list(map(int,input().split()))
	dasie = True
	for i in range(1,n):
		if (l[i]-l[i-1])%2 == 1:
			dasie = False
	if dasie:
		print("YES")
	else:
		print("NO")

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


t = int(input())
for i in range(t):
    n = int(input())
    data = tuple(map(int, input().split()))
    f = data[0] % 2
    for i in data:
        if i % 2 != f:
            print("NO")
            break
    else:
        print("YES")


from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline
 
M = mod = 10**9 + 7
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
def inv_mod(n):return pow(n, mod - 2, mod)
 
def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]

for _ in range(val()):
    n = val()
    l = li()
    m = min(l)
    for i in range(n):
        l[i] -= m
    ans = 'YES'
    for i in range(n):
        if l[i]%2:
            ans = 'NO'
            break
    print(ans)

for i in range(int(input())):
    n = int(input())
    arr = list(map(int, input().split()))
    kek = [0, 0]
    for x in arr:
        kek[x % 2] += 1
    print("YES" if kek[0] == 0 or kek[1] == 0 else "NO")


def one():
    return int(input())


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


for _ in range(one()):
    n = one()
    l = list(more())
    s = 0
    for i in l:
        s += i % 2
    if s%n==0:
        print('YES')
    else:
        print('NO')


for _ in range(int(input())):
    n = int(input())
    a = sorted(map(int, input().split()))

    x = a[0] % 2

    if all(i % 2 == x for i in a):
        print('YES')
    else:
        print('NO')

from sys import stdin,stdout                           #
import math                                            #
import heapq                                           #
                                                       #
t = 1                                                  #
def aint():                                            #
	return int(input().strip())                        #
def lint():                                            #
	return list(map(int,input().split()))              #
def fint():                                            #
	return list(map(int,stdin.readline().split()))     #
                                                       #	
########################################################

def main():
	n=aint()
	l=lint()
	odd=False
	even=False
	for i in l:
		if i%2==1:
			odd=True
		else:
			even=True
	if odd and even:
		print("NO")
	else:
		print("YES")
	#solve

t=int(input())

########################################################
for i in range(t):                                     #
	main()                                             #

import re, math, decimal, bisect
def read(): return input().strip()
def iread(): return int(input().strip())
def viread(): return [int(_) for _ in input().strip().split()]
def round(n): return int(n + 0.5)

DEBUG = 1
# DEBUG = 0
def debug(*args, **kwargs):
    if DEBUG: print(*args, **kwargs)
    
# code goes here
t = iread()
for _ in range(t):
    n = iread()
    arr = viread()
    can = True
    for i in range(n-1):
        if (arr[i] - arr[i+1]) % 2 == 1:
            can = False
            break
    print(["NO", "YES"][int(can)])


# HEY STALKER
for _ in range(int(input())):
    n = int(input())
    l = list(map(int, input().split()))
    e = 0
    o = 0
    for t in l:
        if t % 2:
            o += 1
        else:
            e += 1
    if not e or not o:
        print("YES")
    else:
        print("NO")


def solve(n, a):
    mn = min(a)
    a = [i-mn for i in a]
    for i in a:
        if i%2:
            return "NO"
    return "YES"


def main():
    t = int(input())
    for _ in range(t):
        n = int(input())
        a = [int(i) for i in input().split()]
        print(solve(n, a))


main()



t = int(input())

for loop in range(t):

    n = int(input())

    a = list(map(int,input().split()))

    ans = "YES"
    for i in range(n-1):

        if a[-1] % 2 != a[i] % 2:
            ans = "NO"

    print (ans)


def main():
    import sys
    input = sys.stdin.readline

    for _ in range(int(input())):
        N = int(input())
        A = list(map(int, input().split()))
        flg = A[0] & 1
        ok = 1
        for a in A:
            if a&1 != flg:
                ok = 0
        if ok:
            print('YES')
        else:
            print('NO')


def __starting_point():
    main()

__starting_point()

T = int(input())

for _ in range(T):
    N = int(input())
    L = list(map(int, input().split()))
    if all(l % 2 == L[0] % 2 for l in L):
        print("YES")
    else:
        print("NO")


t = int(input())

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

	s = set()

	for i in heights:
		s.add(i % 2)

		if len(s) == 2:
			break

	if len(s) == 1:
		print('YES')
	else:
		print('NO')

t = int(input())
for case in range(t):
    n = int(input())
    arr = list(map(int, input().split()))
    n_odd = 0
    n_even = 0
    for i in arr:
        if i % 2 == 0:
            n_even += 1
        else:
            n_odd += 1
    if n_even and n_odd:
        print("NO")
    else:
        print("YES")



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

	f=0

	for i in range(n):
		for j in range(i+1,n):
			if(abs(a[i]-a[j])&1):
				f=1
	if(f):
		print("NO")
	else:
		print("YES")

for _ in range(int(input())):
    N=int(input())
    L=list(map(int,input().split()))
    V=[0,0]
    for i in L:
        V[i%2]+=1
    if V[0]==0 or V[1]==0:
        print('YES')
    else:
        print('NO')

import math,sys
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
li = lambda:list(map(int,input().split()))

def case():
    n=int(input())
    a=li()
    c=0
    for i in a:
        if(i%2==0):
            c+=1
    if(c==0 or c==n):
        print("YES")
    else:
        print("NO")

for _ in range(int(input())):
    case()

t = int(input())
while(t):
    t -= 1
    n = int(input())
    a = list(map(int, input().split()))
    rems = set()
    for i in a:
        rems.add(i%2)
    if(len(rems) == 1):
        print("YES")
    else:
        print("NO")

for _ in range(int(input())):
    n = int(input())
    arr = list(map(int, input().split()))
    odd = 0
    even = 0
    for i in arr:
        if i%2==0:
            even += 1
        else:
            odd+=1
    if odd==0 or even==0:
        print("YES")
    else:
        print("NO")


import sys
input = sys.stdin.readline

for _ in range(int(input())):
    n = int(input())
    x = [*map(int, input().split())]
    p = x.pop()
    print("YES" if all((p-i) % 2 == 0 for i in x) else "NO")

from bisect import bisect_left, bisect_right


def go():
    n = int(input())
    a = list(map(int, input().split()))
    ma = min(a)
    return 'YES' if all((aa-ma)%2==0 for aa in a ) else 'NO'

t = int(input())
for _ in range(t):
    print(go())


t = int(input())
for i in range(t):
    n = int(input())
    s = 0
    arr = list(map(int, input().split()))
    mn = min(arr)
    for el in arr:
        s += (el - mn) % 2
    if s == 0:
        print("YES")
    else:
        print("NO")

for _ in range(int(input())):
    N =int(input())
    X = list(map(int, input().split()))
    Max = max(X)
    Check = True
    for i in X:
        if (Max - i) %2!= 0:
            Check = False
            break
    print("YES" if Check else "NO")

import math
 
 
class Read:
    @staticmethod
    def string():
        return input()
 
    @staticmethod
    def int():
        return int(input())
 
    @staticmethod
    def list(sep=' '):
        return input().split(sep)
 
    @staticmethod
    def list_int(sep=' '):
        return list(map(int, input().split(sep)))
 
result = math.inf
 
def solve():
  n = Read.int()
  a = Read.list_int();
  t = 0
  for i in a:
    if i % 2 == 0:
      t += 1
  print('YES' if t == 0 or t == n else 'NO')
 
# query_count = 1
query_count = Read.int()
while query_count:
    query_count -= 1
    solve()

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

qq = int(input())
for _ in range(qq):
    n = int(input())
    dat = list(map(int, input().split()))
    if n == 1:
        print("YES")
        continue
    c = dat[0] % 2
    f = True
    for i in range(n):
        if c != dat[i] % 2:
            f = False
    print("YES" if f else "NO")