n = int(eval(input()))

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



for i in range(n):

    if i == 0:

        ti, xi, yi = 0, 0, 0

    else:

        ti, xi, yi = txy[i-1]

    tf,xf,yf = txy[i]

    dt = tf - ti

    dx = abs(xi-xf)

    dy = abs(yi-yf)



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

        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!=0:

        print("No")

        exit()

print("Yes")
n = int(eval(input()))
txy = [list(map(int, input().split())) for i in range(n)]
for i in range(n):
    if i == 0:
        ti, xi, yi = 0, 0, 0
    else:
        ti, xi, yi = txy[i - 1]
    tf, xf, yf = txy[i]
    dt = tf - ti
    dx = abs(xi - xf)
    dy = abs(yi - yf)
    if dt < dx + dy or (dt - (dx + dy)) % 2 != 0:
        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 != 0:
        print("No")
        exit()
print("Yes")

-txy = [list(map(int, input().split())) for i in range(n)] -    if i == 0: -        ti, xi, yi = 0, 0, 0 -    else: -        ti, xi, yi = txy[i - 1] -    tf, xf, yf = txy[i] -    dt = tf - ti -    dx = abs(xi - xf) -    dy = abs(yi - yf) -    if dt < dx + dy or (dt - (dx + dy)) % 2 != 0: +    t, x, y = list(map(int, input().split())) +    if x + y > t or (x + y + t) % 2 != 0: