n = int(eval(input()))

bt, bx, by = 0, 0, 0

ans = 'Yes'

for i in range(n):

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

    if ((t % 2 == 0 and (x + y) % 2 == 0) or (t % 2 == 1 and (x + y) % 2 == 1)) and (abs(x - bx) + abs(y - by) <= t - bt):

        bt, bx, by = t, x, y

        continue

    else:

        ans = 'No'

        break

print(ans)

n = int(eval(input()))

ans = "Yes"

for _ in range(n):

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

    if (t < x + y) or (t + x + y) % 2 == 1:

        ans = "No"

print(ans)

n = int(eval(input()))
bt, bx, by = 0, 0, 0
ans = "Yes"
for i in range(n):
    t, x, y = list(map(int, input().split()))
    if ((t % 2 == 0 and (x + y) % 2 == 0) or (t % 2 == 1 and (x + y) % 2 == 1)) and (
        abs(x - bx) + abs(y - by) <= t - bt
    ):
        bt, bx, by = t, x, y
        continue
    else:
        ans = "No"
        break
print(ans)

n = int(eval(input()))
ans = "Yes"
for _ in range(n):
    t, x, y = list(map(int, input().split()))
    if (t < x + y) or (t + x + y) % 2 == 1:
        ans = "No"
print(ans)

-bt, bx, by = 0, 0, 0 -for i in range(n): +for _ in range(n): -    if ((t % 2 == 0 and (x + y) % 2 == 0) or (t % 2 == 1 and (x + y) % 2 == 1)) and ( -        abs(x - bx) + abs(y - by) <= t - bt -    ): -        bt, bx, by = t, x, y -        continue -    else: +    if (t < x + y) or (t + x + y) % 2 == 1: -        break