We call two numbers $x$ and $y$ similar if they have the same parity (the same remainder when divided by $2$), or if $|x-y|=1$. For example, in each of the pairs $(2, 6)$, $(4, 3)$, $(11, 7)$, the numbers are similar to each other, and in the pairs $(1, 4)$, $(3, 12)$, they are not.

You are given an array $a$ of $n$ ($n$ is even) positive integers. Check if there is such a partition of the array into pairs that each element of the array belongs to exactly one pair and the numbers in each pair are similar to each other.

For example, for the array $a = [11, 14, 16, 12]$, there is a partition into pairs $(11, 12)$ and $(14, 16)$. The numbers in the first pair are similar because they differ by one, and in the second pair because they are both even.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 1000$) — the number of test cases. Then $t$ test cases follow.

Each test case consists of two lines.

The first line contains an even positive integer $n$ ($2 \le n \le 50$) — length of array $a$.

The second line contains $n$ positive integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 100$).


-----Output-----

For each test case print:  YES if the such a partition exists,  NO otherwise. 

The letters in the words YES and NO can be displayed in any case.


-----Example-----
Input
7
4
11 14 16 12
2
1 8
4
1 1 1 1
4
1 2 5 6
2
12 13
6
1 6 3 10 5 8
6
1 12 3 10 5 8

Output
YES
NO
YES
YES
YES
YES
NO



-----Note-----

The first test case was explained in the statement.

In the second test case, the two given numbers are not similar.

In the third test case, any partition is suitable.
[{"code": "def read_int():\n    return int(input())\n\n\ndef read_ints():\n    return list(map(int, input().split(' ')))\n\n\nt = read_int()\nfor case_num in range(t):\n    n = read_int()\n    a = list(read_ints())\n    cnt = [0 for i in range(101)]\n    even = 0\n    for ai in a:\n        cnt[ai] += 1\n        if ai % 2 == 0:\n            even += 1\n    odd = n - even\n    if even % 2 == 0:\n        print('YES')\n    else:\n        ok = False\n        for i in range(1, 100):\n            if cnt[i] > 0 and cnt[i + 1] > 0:\n                ok = True\n                break\n        print('YES' if ok else 'NO')\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "q = int(input())\nfor i in range(q):\n\tn = int(input())\n\tl = list(map(int,input().split()))\n\tl.sort()\n\tkol = False\n\tfor i in range(1,n):\n\t\tif l[i] == l[i-1] + 1:\n\t\t\tkol =True\n\t\t\tbreak\n\tpar = 0\n\tnpar = 0\n\tfor i in l:\n\t\tif i%2 == 0:\n\t\t\tpar += 1\n\t\telse:\n\t\t\tnpar += 1\n\tif not kol:\n\t\tif par%2 == 0 and npar%2 == 0:\n\t\t\tprint(\"YES\")\n\t\telse:\n\t\t\tprint(\"NO\")\n\telse:\n\t\tif par%2 == 0 and npar%2 == 0:\n\t\t\tprint(\"YES\")\n\t\telif par%2 == 1 and npar%2 == 1:\n\t\t\tprint(\"YES\")\n\t\telse:\n\t\t\tprint(\"NO\")", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    n = int(input())\n    ar = list(map(int, input().split()))\n    ar.sort()\n    a, b = 0, 0\n    for elem in ar:\n        if elem % 2 == 0:\n            a += 1\n        else:\n            b += 1\n    if a % 2 != b % 2:\n        print('NO')\n    else:\n        if a % 2 == b % 2 == 0:\n            print('YES')\n        else:\n            ans = 'NO'\n            for i in range(1, n):\n                if ar[i] - ar[i - 1] == 1:\n                    ans = 'YES'\n                    break\n            print(ans)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "T = int(input())\nfor t in range(T):\n    N = int(input())\n    A = list(map(int, input().split()))\n    par = [a % 2 for a in A]\n    odd = sum(par)\n    even = N - odd\n    res = \"NO\"\n    if (even % 2) == 0 and (odd % 2) == 0:\n        res = \"YES\"\n    elif (even % 2) != 0 and (odd % 2) != 0:\n        sA = sorted(A)\n        for i in range(N - 1):\n            ai = sA[i]\n            aip = sA[i + 1]\n            if aip - ai == 1:\n                res = \"YES\"\n                break\n\n    print(res)\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "import sys\nfrom collections import defaultdict as dd\ndef eprint(*args):\n    print(*args, file=sys.stderr)\nzz=1\n#from math import *\nimport copy\n#sys.setrecursionlimit(10**6)\nif zz:\n\tinput=sys.stdin.readline\nelse:\t\n\tsys.stdin=open('input.txt', 'r')\n\tsys.stdout=open('all.txt','w')\ndef li():\n\treturn [int(x) for x in input().split()]\ndef fi():\n\treturn int(input())\ndef si():\n\treturn list(input().rstrip())\t\ndef mi():\n\treturn \tmap(int,input().split())\t\n\ndef bo(i):\n\treturn ord(i)-ord('a')\n\n\nt=fi()\nwhile t>0:\n\tt-=1\n\tn=fi()\n\ta=li()\n\td={}\n\to=e=0\n\tfor i in a:\n\t\tif i%2:\n\t\t\to+=1\n\t\telse:\n\t\t\te+=1\t\n\t\td[i]=1\t\n\tif o%2==0 :\n\t\tprint(\"YES\")\n\t\tcontinue\n\tflag=0\t\n\tfor i in a:\n\t\tif i+1 in d or i-1 in d:\n\t\t\tprint(\"YES\")\n\t\t\tflag=1\n\t\t\tbreak\n\tif flag==0:\n\t\tprint(\"NO\")\t\t\t\t\t\n", "passed": true, "time": 0.24, "memory": 14360.0, "status": "done"}, {"code": "T = int(input())\n\nfor _ in range(T):\n    n = int(input())\n    aa = list(map(int, input().split()))\n\n    evens = 0\n    odds = 0\n\n    aa.sort()\n\n    ba = -100\n\n    cnt = 0\n    for a in aa:\n        if a % 2 == 0:\n            evens += 1\n        else:\n            odds += 1\n\n        if abs(a - ba) == 1:\n            cnt += 1\n            ba = -100\n        else:\n            ba = a\n\n    evens %= 2\n    odds %= 2\n\n    if evens == 0 and odds == 0:\n        print(\"YES\")\n    else:\n        if cnt >= 1:\n            print(\"YES\")\n        else:\n            print(\"NO\")\n", "passed": true, "time": 0.24, "memory": 14308.0, "status": "done"}, {"code": "T = int(input())\n\nfor t in range(T):\n    N = int(input())\n    A = [int(_) for _ in input().split()]\n    even = [el for el in A if el % 2 == 0]\n    odd = [el for el in A if el % 2 == 1]\n    sA = sorted(A)\n    v = 0\n    for i in range(len(A)-1):\n        if sA[i+1] - sA[i] == 1:\n            v += 1\n    if len(even) % 2 == 0 and len(odd) % 2 == 0:\n        print('YES')\n    else:\n        if v > 0:\n            print('YES')\n        else:\n            print('NO')\n", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "\"\"\"T=int(input())\nfor _ in range(0,T):\n    N=int(input())\n    a,b=map(int,input().split())\n    s=input()\n    s=[int(x) for x in input().split()]\n    for i in range(0,len(s)):\n        a,b=map(int,input().split())\"\"\"\n\n\nT=int(input())\nfor _ in range(0,T):\n    N=int(input())\n    s=[int(x) for x in input().split()]\n    c0=0\n    c1=0\n    pos=[0]*102\n    for i in range(0,len(s)):\n        pos[s[i]]=1\n        if(s[i]%2==0):\n            c0+=1\n        else:\n            c1+=1\n        \n    if(c0%2==0):\n        print('YES')\n    else:\n        temp='NO'\n        for i in range(0,len(pos)-1):\n            if(pos[i]==1 and pos[i+1]==1):\n                temp='YES'\n                break\n        print(temp)\n        \n    \n\n", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "t = int(input())\nfor _ in range(t):\n    n = int(input())\n    s = list(map(int, input().split()))\n    even = []\n    odd = []\n    for i in range(n):\n        if s[i] % 2 == 0:\n            even.append(s[i])\n        else:\n            odd.append(s[i])\n    if len(even) % 2 == 0:\n        print(\"YES\")\n    else:\n        even = set(even)\n        for val in odd:\n            if val - 1 in even or val + 1 in even:\n                print(\"YES\")\n                break\n        else:\n            print(\"NO\")", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "import sys\nq=int(input())\nfor i in range(q):\n    n=int(sys.stdin.readline())\n    a=[int(i) for i in sys.stdin.readline().split()]\n    minrazn=999999\n    a.sort()\n    ch=0\n    nch=0\n    for k in range(n):\n        if k<n-1:\n            if a[k]%2==0:\n                ch+=1\n            else:\n                nch+=1\n            if minrazn>a[k+1]-a[k] and a[k+1]!=a[k] :\n                minrazn=a[k+1]-a[k]\n        else:\n            if a[k]%2==0:\n                ch+=1\n            else:\n                nch+=1\n    if ch%2==0:\n        print('YES')\n    elif minrazn==1:\n        print('YES')\n    else:\n        print('NO')\n        \n", "passed": true, "time": 0.69, "memory": 14132.0, "status": "done"}, {"code": "\"\"\"\nAuthor: Q.E.D\nTime: 2020-05-24 08:43:25\n\"\"\"\nT = int(input())\nfor _ in range(T):\n    n = int(input())\n    a = list(map(int, input().split()))\n    odd, even = [], []\n    for x in a:\n        if x % 2 == 1:\n            odd.append(x)\n        else:\n            even.append(x)\n    if len(odd) % 2 == 0 and len(even) % 2 == 0:\n        ans = 'YES'\n    else:\n        for i in range(len(odd)):\n            valid = False\n            for j in range(len(even)):\n                if abs(odd[i] - even[j]) == 1:\n                    valid = True\n                    break\n            if valid:\n                break\n        ans = 'YES' if valid else 'NO'\n    print(ans)\n\n", "passed": true, "time": 0.14, "memory": 14384.0, "status": "done"}, {"code": "import sys\n# from functools import lru_cache, cmp_to_key\n# from heapq import merge, heapify, heappop, heappush\nfrom math import sqrt, sin, cos, pi\nfrom collections import defaultdict as dd, deque, Counter as C\n# from itertools import combinations as comb, permutations as perm\n# from bisect import bisect_left as bl, bisect_right as br, bisect\n# from time import perf_counter\n# from fractions import Fraction\n\n# sys.setrecursionlimit(pow(10, 6))\n# sys.stdin = open(\"input.txt\", \"r\")\n# sys.stdout = open(\"output.txt\", \"w\")\nmod = pow(10, 9) + 7\nmod2 = 998244353\n\n\ndef data(): return sys.stdin.readline().strip()\n\n\ndef out(*var, end=\"\\n\"): sys.stdout.write(' '.join(map(str, var)) + end)\n\n\ndef l(): return list(sp())\n\n\ndef sl(): return list(ssp())\n\n\ndef sp(): return list(map(int, data().split()))\n\n\ndef ssp(): return list(map(str, data().split()))\n\n\ndef l1d(n, val=0): return [val for i in range(n)]\n\n\ndef l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]\n\n\nfor _ in range(int(data())):\n    n = int(data())\n    arr = l()\n    even, odd = [], []\n    for i in range(n):\n        if arr[i] & 1:\n            odd.append(arr[i])\n            continue\n        even.append(arr[i])\n    if not(len(odd) & 1):\n        out(\"YES\")\n        continue\n    r = False\n    for i in odd:\n        for j in even:\n            if abs(i-j) == 1:\n                r = True\n                break\n        if r:\n            break\n    if r:\n        out(\"YES\")\n        continue\n    out(\"NO\")\n", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    c = int(input())\n    f = sorted([int(i) for i in input().split()])\n    f1 = False\n    ch = 0\n    nech = 0\n    if f[0] % 2 == 1:\n        nech += 1\n    else:\n        ch += 1\n    for i in range(1, c):\n        if f[i] - f[i - 1] == 1:\n            f1 = True\n        if f[i] % 2 == 1:\n            nech += 1\n        else:\n            ch += 1\n\n    if nech % 2 != ch % 2:\n        print('NO')\n    else:\n        if nech % 2 == 0:\n            print('YES')\n        elif f1:\n            print('YES')\n        else:\n            print('NO')\n", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "t=int(input())\nfor you in range(t):\n    n=int(input())\n    l=input().split()\n    li=[int(i) for i in l]\n    lodd=[]\n    leven=[]\n    for i in li:\n        if(i%2):\n            lodd.append(i)\n        else:\n            leven.append(i)\n    if(len(leven)%2==0):\n        print(\"YES\")\n    else:\n        done=0\n        for i in lodd:\n            for j in leven:\n                if(abs(i-j)==1):\n                    done=1\n                    break\n        if(done):\n            print(\"YES\")\n        else:\n            print(\"NO\")\n", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "import sys, math,os\nfrom io import BytesIO, IOBase\n#from bisect import bisect_left as bl, bisect_right as br, insort\n#from heapq import heapify, heappush, heappop\nfrom collections import defaultdict as dd, deque, Counter\n#from itertools import permutations,combinations\ndef data(): return sys.stdin.readline().strip()\ndef mdata(): return list(map(int, data().split()))\ndef outl(var) : sys.stdout.write(' '.join(map(str, var))+'\\n')\ndef out(var) : sys.stdout.write(str(var)+'\\n')\nsys.setrecursionlimit(100000)\nINF = float('inf')\nmod = int(1e9)+7\n\n\ndef main():\n\n    for t in range(int(data())):\n        n=int(data())\n        a=mdata()\n        e=0\n        for i in range(n):\n            if a[i]%2==0:\n                e+=1\n        if e%2==0:\n            out(\"YES\")\n        else:\n            s=set(a)\n            flag=False\n            for i in a:\n                if i+1 in s:\n                    flag=True\n                    break\n            if flag==True:\n                out(\"YES\")\n            else:\n                out(\"NO\")\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}]