can = True

e = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(int(eval(input())))]

for a, b in zip(e[1:], e):

    dt = a[0] - b[0]

    dist = abs(a[1] - b[1]) + abs(a[2] - b[2])

    if dt < dist: can = False; break

    if dt % 2 != dist % 2: can = False; break

print((['No', 'Yes'][can]))
import sys

can = True; eval(input())

e = [[0, 0, 0]] + [list(map(int, e.split())) for e in sys.stdin]

for a, b in zip(e[1:], e):

    t = a[0] - b[0] - abs(a[1] - b[1]) - abs(a[2] - b[2])

    if t < 0 or t % 2 == 1: can = False; break

print((['No', 'Yes'][can]))
can = True
e = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(int(eval(input())))]
for a, b in zip(e[1:], e):
    dt = a[0] - b[0]
    dist = abs(a[1] - b[1]) + abs(a[2] - b[2])
    if dt < dist:
        can = False
        break
    if dt % 2 != dist % 2:
        can = False
        break
print((["No", "Yes"][can]))

import sys

can = True
eval(input())
e = [[0, 0, 0]] + [list(map(int, e.split())) for e in sys.stdin]
for a, b in zip(e[1:], e):
    t = a[0] - b[0] - abs(a[1] - b[1]) - abs(a[2] - b[2])
    if t < 0 or t % 2 == 1:
        can = False
        break
print((["No", "Yes"][can]))

+import sys + -e = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(int(eval(input())))] +eval(input()) +e = [[0, 0, 0]] + [list(map(int, e.split())) for e in sys.stdin] -    dt = a[0] - b[0] -    dist = abs(a[1] - b[1]) + abs(a[2] - b[2]) -    if dt < dist: -        can = False -        break -    if dt % 2 != dist % 2: +    t = a[0] - b[0] - abs(a[1] - b[1]) - abs(a[2] - b[2]) +    if t < 0 or t % 2 == 1: