N = int(eval(input()))

ans = "Yes"

x = 0

y = 0

t = 0

for i in range(N):

    t_i,x_i,y_i = list(map(int,input().split()))

    x_i = abs(x_i-x)

    y_i = abs(y_i-x)

    t_i = abs(t_i-t)

    

    if x_i+y_i <= t_i and (x_i+y_i-t_i)%2 == 0:

        continue

    else:

        ans = "No"

    x = x_i

    y = y_i

    t = t_i



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



txy = list(tuple(map(int,input().split())) for _ in range(N))



t_0 = 0

x_0 = 0

y_0 = 0



for t,x,y in txy:

    dt = t - t_0

    dx = x - x_0

    dy = y - y_0

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

        t_0 = t

        x_0 = x

        y_0 = y

    else:

        print("No")

        exit()



print("Yes")
N = int(eval(input()))
ans = "Yes"
x = 0
y = 0
t = 0
for i in range(N):
    t_i, x_i, y_i = list(map(int, input().split()))
    x_i = abs(x_i - x)
    y_i = abs(y_i - x)
    t_i = abs(t_i - t)
    if x_i + y_i <= t_i and (x_i + y_i - t_i) % 2 == 0:
        continue
    else:
        ans = "No"
    x = x_i
    y = y_i
    t = t_i
print(ans)

N = int(eval(input()))
txy = list(tuple(map(int, input().split())) for _ in range(N))
t_0 = 0
x_0 = 0
y_0 = 0
for t, x, y in txy:
    dt = t - t_0
    dx = x - x_0
    dy = y - y_0
    if (abs(dx) + abs(dy)) % 2 == dt % 2 and (abs(dx) + abs(dy)) <= dt:
        t_0 = t
        x_0 = x
        y_0 = y
    else:
        print("No")
        exit()
print("Yes")

-ans = "Yes" -x = 0 -y = 0 -t = 0 -for i in range(N): -    t_i, x_i, y_i = list(map(int, input().split())) -    x_i = abs(x_i - x) -    y_i = abs(y_i - x) -    t_i = abs(t_i - t) -    if x_i + y_i <= t_i and (x_i + y_i - t_i) % 2 == 0: -        continue +txy = list(tuple(map(int, input().split())) for _ in range(N)) +t_0 = 0 +x_0 = 0 +y_0 = 0 +for t, x, y in txy: +    dt = t - t_0 +    dx = x - x_0 +    dy = y - y_0 +    if (abs(dx) + abs(dy)) % 2 == dt % 2 and (abs(dx) + abs(dy)) <= dt: +        t_0 = t +        x_0 = x +        y_0 = y -        ans = "No" -    x = x_i -    y = y_i -    t = t_i -print(ans) +        print("No") +        exit() +print("Yes")