n=int(eval(input()))

t,x,y=[0],[0],[0]

for i in range(n):

    T,X,Y=list(map(int,input().split()))

    t.append(T)

    x.append(X)

    y.append(Y)

#print(t,x,y)

for i in range(n):

    time=t[i+1]-t[i]

    dx=abs(x[i+1]-x[i])

    dy=abs(y[i+1]-y[i])



    if time<dx+dy or (time+dx+dy)%2!=0:

        print('No')

        exit()

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

t,x,y=[],[],[]



for i in range(n):

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

    t.append(a)

    x.append(b)

    y.append(c)



current=[0,0]

for i in range(n):

    next=[x[i]-current[0],y[i]-current[1]]

    if abs(sum(next))>t[i] or (abs(sum(next))+t[i])%2!=0:

        print('No')

        exit()

print('Yes')
n = int(eval(input()))
t, x, y = [0], [0], [0]
for i in range(n):
    T, X, Y = list(map(int, input().split()))
    t.append(T)
    x.append(X)
    y.append(Y)
# print(t,x,y)
for i in range(n):
    time = t[i + 1] - t[i]
    dx = abs(x[i + 1] - x[i])
    dy = abs(y[i + 1] - y[i])
    if time < dx + dy or (time + dx + dy) % 2 != 0:
        print("No")
        exit()
print("Yes")

n = int(eval(input()))
t, x, y = [], [], []
for i in range(n):
    a, b, c = list(map(int, input().split()))
    t.append(a)
    x.append(b)
    y.append(c)
current = [0, 0]
for i in range(n):
    next = [x[i] - current[0], y[i] - current[1]]
    if abs(sum(next)) > t[i] or (abs(sum(next)) + t[i]) % 2 != 0:
        print("No")
        exit()
print("Yes")

-t, x, y = [0], [0], [0] +t, x, y = [], [], [] -    T, X, Y = list(map(int, input().split())) -    t.append(T) -    x.append(X) -    y.append(Y) -# print(t,x,y) +    a, b, c = list(map(int, input().split())) +    t.append(a) +    x.append(b) +    y.append(c) +current = [0, 0] -    time = t[i + 1] - t[i] -    dx = abs(x[i + 1] - x[i]) -    dy = abs(y[i + 1] - y[i]) -    if time < dx + dy or (time + dx + dy) % 2 != 0: +    next = [x[i] - current[0], y[i] - current[1]] +    if abs(sum(next)) > t[i] or (abs(sum(next)) + t[i]) % 2 != 0: