import sys

eval(input())

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

for (t0, a0, b0), (t1, a1, b1) in zip(e, e[1:]):

    d = (t1 - t0) - abs(a1 - a0) - abs(b1 - b0)

    if d < 0 or d % 2 == 1:

        print('No')

        exit()

print('Yes')
import sys

eval(input())

pt, px, py = 0, 0, 0

for e in sys.stdin:

    ct, cx, cy = list(map(int, e.split()))

    d = (ct - pt) - abs(cx - px) - abs(cy - py)

    if d < 0 or d % 2 == 1:

        print('No')

        break

    pt, px, py = ct, cx, cy

else:

    print('Yes')
import sys

eval(input())
e = [[0, 0, 0]] + [list(map(int, e.split())) for e in sys.stdin]
for (t0, a0, b0), (t1, a1, b1) in zip(e, e[1:]):
    d = (t1 - t0) - abs(a1 - a0) - abs(b1 - b0)
    if d < 0 or d % 2 == 1:
        print("No")
        exit()
print("Yes")

import sys

eval(input())
pt, px, py = 0, 0, 0
for e in sys.stdin:
    ct, cx, cy = list(map(int, e.split()))
    d = (ct - pt) - abs(cx - px) - abs(cy - py)
    if d < 0 or d % 2 == 1:
        print("No")
        break
    pt, px, py = ct, cx, cy
else:
    print("Yes")

-e = [[0, 0, 0]] + [list(map(int, e.split())) for e in sys.stdin] -for (t0, a0, b0), (t1, a1, b1) in zip(e, e[1:]): -    d = (t1 - t0) - abs(a1 - a0) - abs(b1 - b0) +pt, px, py = 0, 0, 0 +for e in sys.stdin: +    ct, cx, cy = list(map(int, e.split())) +    d = (ct - pt) - abs(cx - px) - abs(cy - py) -        exit() -print("Yes") +        break +    pt, px, py = ct, cx, cy +else: +    print("Yes")