N = int(eval(input()))

for i in range(N):

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

    if abs(b)+abs(c)>a or (a+b+c)%2==1:

        print("No")

        exit()

print("Yes")
n = int(eval(input()))

for i in range(n):

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

    if (x + y) > t or (x + y + t) % 2:

        print("No")

        exit()

print("Yes")

N = int(eval(input()))
for i in range(N):
    a, b, c = list(map(int, input().split()))
    if abs(b) + abs(c) > a or (a + b + c) % 2 == 1:
        print("No")
        exit()
print("Yes")

n = int(eval(input()))
for i in range(n):
    t, x, y = list(map(int, input().split()))
    if (x + y) > t or (x + y + t) % 2:
        print("No")
        exit()
print("Yes")

-N = int(eval(input())) -for i in range(N): -    a, b, c = list(map(int, input().split())) -    if abs(b) + abs(c) > a or (a + b + c) % 2 == 1: +n = int(eval(input())) +for i in range(n): +    t, x, y = list(map(int, input().split())) +    if (x + y) > t or (x + y + t) % 2: