n = int(eval(input()))

points = []

for i in range(n):

    points.append(list(map(int, input().split(" "))))



t_pre, x_pre, y_pre = 0, 0, 0

reachable = True

for point in points:

    t, x, y = list(map(int, point))

    diff_t = t - t_pre

    p = x + y

    p_pre = x_pre + y_pre

    move = 0

    for _ in range(diff_t):

        move += 1 if p > (p_pre + move) else -1



    if p - p_pre != move:

        reachable = False

        break



    t_pre, x_pre, y_pre = t, x, y



print(("Yes" if reachable == True else "No"))
n = int(eval(input()))

t = [0]

x = [0]

y = [0]

for _ in range(n):

    t_tmp, x_tmp, y_tmp = list(map(int, input().split(" ")))

    t.append(t_tmp)

    x.append(x_tmp)

    y.append(y_tmp)



reachable = True

for j in range(1, n + 1):

    dt = t[j] - t[j - 1]

    dist = abs(x[j] - x[j - 1]) + abs(y[j] - y[j - 1])

    if dt < dist or dist % 2 != dt % 2:

        reachable = False



print(("Yes" if reachable == True else "No"))

n = int(eval(input()))
points = []
for i in range(n):
    points.append(list(map(int, input().split(" "))))
t_pre, x_pre, y_pre = 0, 0, 0
reachable = True
for point in points:
    t, x, y = list(map(int, point))
    diff_t = t - t_pre
    p = x + y
    p_pre = x_pre + y_pre
    move = 0
    for _ in range(diff_t):
        move += 1 if p > (p_pre + move) else -1
    if p - p_pre != move:
        reachable = False
        break
    t_pre, x_pre, y_pre = t, x, y
print(("Yes" if reachable == True else "No"))

n = int(eval(input()))
t = [0]
x = [0]
y = [0]
for _ in range(n):
    t_tmp, x_tmp, y_tmp = list(map(int, input().split(" ")))
    t.append(t_tmp)
    x.append(x_tmp)
    y.append(y_tmp)
reachable = True
for j in range(1, n + 1):
    dt = t[j] - t[j - 1]
    dist = abs(x[j] - x[j - 1]) + abs(y[j] - y[j - 1])
    if dt < dist or dist % 2 != dt % 2:
        reachable = False
print(("Yes" if reachable == True else "No"))

-points = [] -for i in range(n): -    points.append(list(map(int, input().split(" ")))) -t_pre, x_pre, y_pre = 0, 0, 0 +t = [0] +x = [0] +y = [0] +for _ in range(n): +    t_tmp, x_tmp, y_tmp = list(map(int, input().split(" "))) +    t.append(t_tmp) +    x.append(x_tmp) +    y.append(y_tmp) -for point in points: -    t, x, y = list(map(int, point)) -    diff_t = t - t_pre -    p = x + y -    p_pre = x_pre + y_pre -    move = 0 -    for _ in range(diff_t): -        move += 1 if p > (p_pre + move) else -1 -    if p - p_pre != move: +for j in range(1, n + 1): +    dt = t[j] - t[j - 1] +    dist = abs(x[j] - x[j - 1]) + abs(y[j] - y[j - 1]) +    if dt < dist or dist % 2 != dt % 2: -        break -    t_pre, x_pre, y_pre = t, x, y