N=int(eval(input()))

txy=[list(map(int,input().split())) for i in range(N)]

ans=0

for i in range(N):

    t,x,y=txy[i][0],txy[i][1],txy[i][2]

    if x+y<=t and t%2==(x+y)%2:ans+=1

print(("Yes" if ans==N else "No"))
N=int(eval(input()))

count=0

for i in range(N):

    t,x,y=list(map(int,input().split()))

    if x+y<=t and t%2==(x+y)%2:count+=1

print(("Yes" if count==N else "No"))
N = int(eval(input()))
txy = [list(map(int, input().split())) for i in range(N)]
ans = 0
for i in range(N):
    t, x, y = txy[i][0], txy[i][1], txy[i][2]
    if x + y <= t and t % 2 == (x + y) % 2:
        ans += 1
print(("Yes" if ans == N else "No"))

N = int(eval(input()))
count = 0
for i in range(N):
    t, x, y = list(map(int, input().split()))
    if x + y <= t and t % 2 == (x + y) % 2:
        count += 1
print(("Yes" if count == N else "No"))

-txy = [list(map(int, input().split())) for i in range(N)] -ans = 0 +count = 0 -    t, x, y = txy[i][0], txy[i][1], txy[i][2] +    t, x, y = list(map(int, input().split())) -        ans += 1 -print(("Yes" if ans == N else "No")) +        count += 1 +print(("Yes" if count == N else "No"))