n = int(eval(input()))

a0 = [0,0,0]

ans = "Yes"

for i in range(n):

    ai = list(map(int,input().split()))

    t = ai[0] - a0[0]

    d = abs(ai[1] - a0[1])+ abs(ai[2] - a0[2])

    if t < d or t%2 != d%2:

        ans = "No"

    a0 = ai

print(ans)
n = int(eval(input()))

t0,x0,y0 = 0,0,0

for i in range(n):

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

    if abs(t0-t)%2 != (abs(x0-x)+abs(y0-y))%2 or (abs(x0-x)+abs(y0-y)) > abs(t0-t):

        print("No")

        exit()

    t0,x0,y0, = t,x,y

else:

    print("Yes")
n = int(eval(input()))
a0 = [0, 0, 0]
ans = "Yes"
for i in range(n):
    ai = list(map(int, input().split()))
    t = ai[0] - a0[0]
    d = abs(ai[1] - a0[1]) + abs(ai[2] - a0[2])
    if t < d or t % 2 != d % 2:
        ans = "No"
    a0 = ai
print(ans)

n = int(eval(input()))
t0, x0, y0 = 0, 0, 0
for i in range(n):
    t, x, y = list(map(int, input().split()))
    if abs(t0 - t) % 2 != (abs(x0 - x) + abs(y0 - y)) % 2 or (
        abs(x0 - x) + abs(y0 - y)
    ) > abs(t0 - t):
        print("No")
        exit()
    t0, x0, y0, = (
        t,
        x,
        y,
    )
else:
    print("Yes")

-a0 = [0, 0, 0] -ans = "Yes" +t0, x0, y0 = 0, 0, 0 -    ai = list(map(int, input().split())) -    t = ai[0] - a0[0] -    d = abs(ai[1] - a0[1]) + abs(ai[2] - a0[2]) -    if t < d or t % 2 != d % 2: -        ans = "No" -    a0 = ai -print(ans) +    t, x, y = list(map(int, input().split())) +    if abs(t0 - t) % 2 != (abs(x0 - x) + abs(y0 - y)) % 2 or ( +        abs(x0 - x) + abs(y0 - y) +    ) > abs(t0 - t): +        print("No") +        exit() +    t0, x0, y0, = ( +        t, +        x, +        y, +    ) +else: +    print("Yes")