Boboniu gives you

  $r$ red balls,  $g$ green balls,  $b$ blue balls,  $w$ white balls. 

He allows you to do the following operation as many times as you want: 

  Pick a red ball, a green ball, and a blue ball and then change their color to white. 

You should answer if it's possible to arrange all the balls into a palindrome after several (possibly zero) number of described operations. 


-----Input-----

The first line contains one integer $T$ ($1\le T\le 100$) denoting the number of test cases.

For each of the next $T$ cases, the first line contains four integers $r$, $g$, $b$ and $w$ ($0\le r,g,b,w\le 10^9$).


-----Output-----

For each test case, print "Yes" if it's possible to arrange all the balls into a palindrome after doing several (possibly zero) number of described operations. Otherwise, print "No".


-----Example-----
Input
4
0 1 1 1
8 1 9 3
0 0 0 0
1000000000 1000000000 1000000000 1000000000

Output
No
Yes
Yes
Yes



-----Note-----

In the first test case, you're not able to do any operation and you can never arrange three balls of distinct colors into a palindrome.

In the second test case, after doing one operation, changing $(8,1,9,3)$ to $(7,0,8,6)$, one of those possible palindromes may be "rrrwwwbbbbrbbbbwwwrrr".

A palindrome is a word, phrase, or sequence that reads the same backwards as forwards. For example, "rggbwbggr", "b", "gg" are palindromes while "rgbb", "gbbgr" are not. Notice that an empty word, phrase, or sequence is palindrome.

Difficulty: interview

Starter code:

Solutions:
t = int(input())
while t:
    arr = list(map(int, input().split()))
    c = 0
    for i in arr:
        if i % 2 == 1:
            c += 1
    if c <= 1:
        print("Yes")
    else:
        if arr[0] and arr[1] and arr[2]:
            arr[3] += 3
            arr[0] -= 1
            arr[1] -= 1
            arr[2] -= 1
            c = 0
            for i in arr:
                if i % 2 == 1:
                    c += 1
            if c <= 1:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    t -= 1

for t in range(int(input())):
    r,g,b,w = list(map(int, input().split()))
    if r==0 or g==0 or b==0:
        if r%2+g%2+b%2+w%2 <= 1:
            print("Yes")
        else:
            print("No")
    else:
        if r%2+g%2+b%2+w%2 == 2:
            print("No")
        else:
            print("Yes")


mod = 10**9 + 7
def solve():
    r, g, b, w = map(int, input().split())
    ok = False
    for i in range(20):
        if (r % 2 + g % 2 + b % 2 + w % 2) <= 1:
            ok = True
        mn = min(r, g, b, 1)
        r -= mn
        g -= mn
        b -= mn
        w += 3 * mn
    print('Yes' if ok else 'No')
t = 1
t = int(input())
for _ in range(t):
    solve()

def count():
	ans = 0
	if not r%2:
		ans += 1
	if not g%2:
		ans += 1
	if not b%2:
		ans += 1
	if not w%2:
		ans += 1
	return ans

for nt in range(int(input())):
	r,g,b,w = map(int,input().split())
	if count()>=3:
		print ("Yes")
		continue
	if min(r,g,b)>0:
		r -= 1
		g -= 1
		b -= 1
		w += 3
		if count()>=3:
			print ("Yes")
		else:
			print ("No")
		continue
	print ("No")

t = int(input())

for _ in range(t):
    r,g,b,w = list(map(int,input().split()))
    if r%2 + g%2 + b%2 + w%2 <= 1:
        print('Yes')
        continue
    if r>0 and g>0 and b>0:
        r -= 1
        g -= 1
        b -= 1
        w += 3
        if r%2 + g%2 + b%2 + w%2 <= 1:
            print('Yes')
        else:
            print('No')
    else:
        print('No')


import sys
# sys.setrecursionlimit(10**6) 
input=sys.stdin.readline
t=int(input())
def check(r,g,b,w):
    if(r>=0 and g>=0 and b>=0 and w>=0):
        c=0
        if(r%2!=0):
            c+=1
        if(g%2!=0):
            c+=1
        if(b%2!=0):
            c+=1
        if(w%2!=0):
            c+=1
        if(c==0 or c==1):
            return True
    
    return False
for t1 in range(t):
    r,g,b,w=list(map(int,input().split(" ")))
    if(check(r,g,b,w) or check(r-1,g-1,b-1,w+1)):
        print("Yes")
    else:
        print("No")


import sys
input = sys.stdin.readline


def main():
    t = int(input())
    for _ in range(t):
        R, G, B, W = [int(x) for x in input().split()]
        if R % 2 + G % 2 + B % 2 + W % 2 <= 1:
            print("Yes")
        else:
            if R >= 1 and G >= 1 and B >= 1:
                R -= 1
                G -= 1
                B -= 1
                W += 3
                if R % 2 + G % 2 + B % 2 + W % 2 <= 1:
                    print("Yes")
                else:
                    print("No")
            else:
                print("No")

        
    

def __starting_point():
    main()



__starting_point()

mod=10**9+7
for _ in range (int(input())):
    r,g,b,w=map(int,input().split())
    ch=0
    if w%2==1 and r%2==g%2==b%2==0:
        ch=1
    elif w%2==0 and (r%2+g%2+b%2)<=1:
        ch=1
    if r>0 and g>0 and b>0:
        r-=1
        g-=1
        b-=1
        w+=3
    
    if w%2==1 and r%2==g%2==b%2==0:
        ch=1
    elif w%2==0 and (r%2+g%2+b%2)<=1:
        ch=1
    if ch==1:
        print("Yes")
    else:
        print("No")

t = int(input())
for case in range(t):
    r, g, b, w = list(map(int, input().split()))
    nodd = (r % 2) + (g % 2) + (b % 2) + (w % 2)
    # print("nodd:", nodd)
    if nodd == 2:
        print("No")
    elif nodd <= 1:
        print("Yes")
    else:
        if r == 0 or g == 0 or b == 0:
            print("No")
        else:
            print("Yes")

def a(x):
    n_e = 0
    n_o = 0
    for a in x:
        if a % 2 == 1:
            n_o += 1
        else:
            n_e += 1
    return (n_o, n_e)

T = int(input())
for _ in range(T):
    r,g,b,w = list(map(int,input().split()))
    z = a([r,g,b,w])
    if z[0] <= 1:
        print("Yes")
        continue
    elif r >= 1 and g >= 1 and b >= 1:
        w += 1
        r -= 1
        g -=1 
        b -= 1
        z = a([r,g,b,w])
        if z[0] <= 1:
            print("Yes")
            continue
    print("No")
        



lst = [0, 0, 4, 8]
mod = 10 ** 9 + 7
for i in range(4, 10 ** 6 + 1):
    lst.append((lst[-1] * 2) % mod)


def main(case):
    r, g, b, w = list(map(int, input().split()))
    if (r % 2) + (g % 2) + (b % 2) + (w % 2) <= 1:
        print("Yes")
    else:

        d = min(r, g, b, 1)
        w += d * 3
        r -= d
        g -= d
        b -= d
        if (r % 2) + (g % 2) + (b % 2) + (w % 2) <= 1:
            print("Yes")
        else:
            print("No")


def __starting_point():
    t = int(input())
    for i in range(t):
        main(i + 1)

__starting_point()

#!/usr/bin/env pypy3

T = int(input())

def ok(r,g,b,w):
    if min(r,g,b,w) < 0: return False

    odds = [x for x in [r,g,b,w] if x % 2 == 1]

    return len(odds) <= 1

def ans(r,g,b,w):
    for _ in range(200):
        if ok(r,g,b,w): return True
        r -= 1
        g -= 1
        b -= 1
        w += 1
    return False

for t in range(T):
    r, g, b, w = input().split()
    r = int(r)
    g = int(g)
    b = int(b)
    w = int(w)

    if ans(r,g,b,w):
        print("Yes")
    else:
        print("No")


from collections import defaultdict as dd
import math
import sys
import string
input=sys.stdin.readline
def nn():
	return int(input())

def li():
	return list(input())

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

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


def solve():

	r,g,b,w = mi()
	par = r%2+g%2+b%2+w%2
	if par<=1:
		print('Yes')
		return
	elif r>=1 and g>=1 and b>=1:
		if par==3 or par==4:
			print('Yes')
			return
	print('No')
q=nn()

for _ in range(q):
	solve()


for _ in range(int(input())):
    r,g,b,w = list(map(int,input().split()))
    works = False
    if sum([i%2 for i in [r,g,b,w]]) <= 1:
        works = True
    if min(r,g,b) > 0:
        r-=1
        b-=1
        g-=1
        w+=1
        if sum([i%2 for i in [r,g,b,w]]) <= 1:
            works = True
    if works:
        print("Yes")
    else:
        print("No")


#!/usr/bin/env python3
import sys
input = sys.stdin.readline

def is_ok(r, g, b, w):
    odd_cnt = 0
    if r % 2 == 1:
        odd_cnt += 1
    if g % 2 == 1:
        odd_cnt += 1
    if b % 2 == 1:
        odd_cnt += 1
    if w % 2 == 1:
        odd_cnt += 1
    if odd_cnt <= 1:
        return True
    else:
        return False

t = int(input())
for _ in range(t):
    r, g, b, w = map(int, input().split())
    if is_ok(r, g, b, w):
        print("Yes")
        continue
    ok = False
    for _ in range(4):
        if r > 0 and g > 0 and b > 0:
            r -= 1; g -= 1; b -= 1; w += 1
            ok = is_ok(r, g, b, w)
        if ok:
            break
    if ok:
        print("Yes")
    else:
        print("No")

import math as mt
def tran(arr):
    if arr[0]==0 or arr[1]==0 or arr[2]==0:
        o=0
        for i in arr:
            if i%2==1:
                o+=1
        if o>1:
            return "No"
        else:
            return "Yes"
    else:
        o = 0
        for i in arr:
            if i % 2 == 1:
                o += 1
        if o==2:
            return "No"
        else:
            return "Yes"
def __starting_point():
    t = int(input())
    ans = []
    for i in range(t):
        nk = list(map(int, input().rstrip().split()))
        r = tran(nk)
        ans.append(r)
    for i in ans:
        print(i)

__starting_point()

#
#    ------------------------------------------------
#           ____          _     Generatered using
#          / ___|        | |
#         | |    __ _  __| | ___ _ __  ______ _
#         | |   / _` |/ _` |/ _ \ '_ \|_  / _` |
#         | |__| (_| | (_| |  __/ | | |/ / (_| |
#          \____\____|\____|\___|_| |_/___\____|
#
#      GNU Affero General Public License v3.0
#    ------------------------------------------------
#    Author   : prophet
#    Created  : 2020-08-12 10:41:11.229095
#    UUID     : H1wm7mv97N5BgWH3
#    ------------------------------------------------
#
production = True

import sys, math, collections, bisect, itertools, heapq, decimal, random, copy, re

def input(f = 0, m = 0):

    if m > 0: return [input(f) for i in range(m)]
    else:
        l = sys.stdin.readline()[:-1]

        if f >= 10:
            u = False
            f = int(str(f)[-1])
        else: u = True

        if f == 0: p = [l]
        elif f == 1: p = list(map(int, l.split()))
        elif f == 2: p = list(map(float, l.split()))
        elif f == 3: p = list(l)
        elif f == 4: p = list(map(int, list(l)))
        elif f == 5: p = l.split()

        return p if u else p[0]

def out(l, f = 0, n = True):

    if f == 0: p = str(l)
    elif f == 1: p = " ".join(map(str, l))
    elif f == 2: p = "\n".join(map(str, l))
    elif f == 3: p = "".join(map(str, l))

    print(p, end = "\n" if n else "")

def log(*args):
    if not production:
        print("$$$", end = "")
        print(*args)

enu = enumerate
ter = lambda a, b, c: b if a else c
ceil = lambda a, b: -(-a // b)

def mapl(i, f = 0):

    if f == 0: return list(map(int, i))
    elif f == 1: return list(map(str, i))
    elif f == 2: return list(map(list, i))

#
#   >>>>>>>>>>>>>>> START OF SOLUTION <<<<<<<<<<<<<<
#


def solve():

    r, g, b, w = input(1)

    if r + g + b + w == 0:
        out("Yes")
        return

    y = 0
    for i in (r, g, b, w):
        if i & 1:
            y += 1

    if y < 2:
        out("Yes")
        return

    if r and g and b:
        r -= 1
        g -= 1
        b -= 1
        w += 3

    y = 0
    for i in (r, g, b, w):
        if i & 1:
            y += 1

    if y < 2:
        out("Yes")
        return
    else:
        out("No")

    return


for i in range(input(11)): solve()

#
#   >>>>>>>>>>>>>>>> END OF SOLUTION <<<<<<<<<<<<<<<
#


def solve():
    r, g, b, w = list(map(int, input().split()))
    if min([r, g, b]) == 0:
        if r % 2 + g % 2 + b % 2 + w % 2 > 1:
            print('No')
        else:
            print('Yes')
    else:
        r2, g2, b2, w2 = r - 1, g - 1, b - 1, w + 3
        if (r2 % 2 + g2 % 2 + b2 % 2 + w2 % 2 > 1) and (r % 2 + g % 2 + b % 2 + w % 2) > 1:
            print('No')
        else:
            print('Yes')

[solve() for x in range(int(input()))]


t=int(input())
for _ in range(t):
	r,g,b,w=map(int,input().split())
	if(r%2==0 and g%2==0 and b%2==0 and w%2==0):
		print("Yes")
	elif(r%2==0 and g%2==0 and b%2==0):
		print("Yes")
	elif(r%2==0 and g%2==0 and w%2==0):
		print("Yes")
	elif(r%2==0 and b%2==0 and w%2==0):
		print("Yes")
	elif(w%2==0 and g%2==0 and b%2==0):
		print("Yes")
	else:
		if(r>0 and g>0 and b>0):
			r-=1
			g-=1
			b-=1
			w+=3
			if(r%2==0 and g%2==0 and b%2==0 and w%2==0):
				print("Yes")
			elif(r%2==0 and g%2==0 and b%2==0):
				print("Yes")
			elif(r%2==0 and g%2==0 and w%2==0):
				print("Yes")
			elif(r%2==0 and b%2==0 and w%2==0):
				print("Yes")
			elif(w%2==0 and g%2==0 and b%2==0):
				print("Yes")
			else:
				print("No")
		else:
			print("No")