import sys

N = int(eval(input()))

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

p_x, p_y = 0, 0

for i in range(N):

    t_t, x_t, y_t = list(map(int, input().split()))

    t.append(t_t)

    x.append(x_t)

    y.append(y_t)

for i in range(N):

    if int(t[i]) < int(x[i]) + int(y[i]) or t[i] % 2 != (x[i] + y[i]) % 2:

        print("No")

        sys.exit()

print("Yes")



N = int(eval(input()))

t, x, y = 0, 0, 0

for i in range(N):

    t_1, x_1, y_1 = list(map(int, input().split()))

    distance = abs(x - x_1) + abs(y - y_1)

    if distance > t_1 - t or (t_1 - t - distance) % 2 != 0:

        print("No")

        exit()

print("Yes")

import sys

N = int(eval(input()))
t, x, y = [], [], []
p_x, p_y = 0, 0
for i in range(N):
    t_t, x_t, y_t = list(map(int, input().split()))
    t.append(t_t)
    x.append(x_t)
    y.append(y_t)
for i in range(N):
    if int(t[i]) < int(x[i]) + int(y[i]) or t[i] % 2 != (x[i] + y[i]) % 2:
        print("No")
        sys.exit()
print("Yes")

N = int(eval(input()))
t, x, y = 0, 0, 0
for i in range(N):
    t_1, x_1, y_1 = list(map(int, input().split()))
    distance = abs(x - x_1) + abs(y - y_1)
    if distance > t_1 - t or (t_1 - t - distance) % 2 != 0:
        print("No")
        exit()
print("Yes")

-import sys - -t, x, y = [], [], [] -p_x, p_y = 0, 0 +t, x, y = 0, 0, 0 -    t_t, x_t, y_t = list(map(int, input().split())) -    t.append(t_t) -    x.append(x_t) -    y.append(y_t) -for i in range(N): -    if int(t[i]) < int(x[i]) + int(y[i]) or t[i] % 2 != (x[i] + y[i]) % 2: +    t_1, x_1, y_1 = list(map(int, input().split())) +    distance = abs(x - x_1) + abs(y - y_1) +    if distance > t_1 - t or (t_1 - t - distance) % 2 != 0: -        sys.exit() +        exit()