N=int(eval(input()))

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

for i in range(N):

    t=T[i][0]

    j=T[i][1]+T[i][2]

    if t<j or (t+j)%2:

        print("No")

        exit()

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

for i in range(N):

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

    j=x+y

    if t<j or (t+j)%2:

        print("No")

        exit()

print("Yes")
N = int(eval(input()))
T = [list(map(int, input().split())) for i in range(N)]
for i in range(N):
    t = T[i][0]
    j = T[i][1] + T[i][2]
    if t < j or (t + j) % 2:
        print("No")
        exit()
print("Yes")

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

-T = [list(map(int, input().split())) for i in range(N)] -    t = T[i][0] -    j = T[i][1] + T[i][2] +    t, x, y = list(map(int, input().split())) +    j = x + y