# https://atcoder.jp/contests/abc086/tasks/arc089_a

t0 = 0

x0 = 0

y0 = 0

n = int(eval(input()))

result = "Yes"



for i in range(n):

    t1, x1, y1 = list(map(int, input().split()))

    dt = t1 - t0

    dx = x1 - x0

    dy = y1 - y0

    if ((dx + dy)%2 == dt % 2) and (dx + dy) <= dt:

        t0 = t1

        x0 = x1

        y0 = y1

    else:

        result = "No"



print(result)

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")
# https://atcoder.jp/contests/abc086/tasks/arc089_a
t0 = 0
x0 = 0
y0 = 0
n = int(eval(input()))
result = "Yes"
for i in range(n):
    t1, x1, y1 = list(map(int, input().split()))
    dt = t1 - t0
    dx = x1 - x0
    dy = y1 - y0
    if ((dx + dy) % 2 == dt % 2) and (dx + dy) <= dt:
        t0 = t1
        x0 = x1
        y0 = y1
    else:
        result = "No"
print(result)

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")

-# https://atcoder.jp/contests/abc086/tasks/arc089_a -t0 = 0 -x0 = 0 -y0 = 0 -result = "Yes" -    t1, x1, y1 = list(map(int, input().split())) -    dt = t1 - t0 -    dx = x1 - x0 -    dy = y1 - y0 -    if ((dx + dy) % 2 == dt % 2) and (dx + dy) <= dt: -        t0 = t1 -        x0 = x1 -        y0 = y1 -    else: -        result = "No" -print(result) +    t, x, y = list(map(int, input().split())) +    if (x + y) > t or (x + y + t) % 2: +        print("No") +        exit() +print("Yes")