N = int(eval(input()))

txy = [(0, 0, 0)] + [tuple(map(int, input().split())) for _ in range(N)]

for i in range(N):

    t1, x1, y1 = txy[i]

    t2, x2, y2 = txy[i+1]

    if abs(x2-x1) + abs(y2-y1) <= t2 - t1 and (x1+y1+x2+y2) % 2 == (t2-t1) % 2:

        continue

    else:

        print('No')

        exit()

print('Yes')
N = int(eval(input()))

t0 = x0 = y0 = 0

for _ in range(N):

    t1, x1, y1 = list(map(int, input().split()))

    d = abs(x1 - x0) + abs(y1 - y0)

    if d > t1 - t0 or d % 2 != (t1 - t0) % 2:

        print('No')

        exit()

    t0, x0, y0 = t1, x1, y1

print('Yes')

N = int(eval(input()))
txy = [(0, 0, 0)] + [tuple(map(int, input().split())) for _ in range(N)]
for i in range(N):
    t1, x1, y1 = txy[i]
    t2, x2, y2 = txy[i + 1]
    if (
        abs(x2 - x1) + abs(y2 - y1) <= t2 - t1
        and (x1 + y1 + x2 + y2) % 2 == (t2 - t1) % 2
    ):
        continue
    else:
        print("No")
        exit()
print("Yes")

N = int(eval(input()))
t0 = x0 = y0 = 0
for _ in range(N):
    t1, x1, y1 = list(map(int, input().split()))
    d = abs(x1 - x0) + abs(y1 - y0)
    if d > t1 - t0 or d % 2 != (t1 - t0) % 2:
        print("No")
        exit()
    t0, x0, y0 = t1, x1, y1
print("Yes")

-txy = [(0, 0, 0)] + [tuple(map(int, input().split())) for _ in range(N)] -for i in range(N): -    t1, x1, y1 = txy[i] -    t2, x2, y2 = txy[i + 1] -    if ( -        abs(x2 - x1) + abs(y2 - y1) <= t2 - t1 -        and (x1 + y1 + x2 + y2) % 2 == (t2 - t1) % 2 -    ): -        continue -    else: +t0 = x0 = y0 = 0 +for _ in range(N): +    t1, x1, y1 = list(map(int, input().split())) +    d = abs(x1 - x0) + abs(y1 - y0) +    if d > t1 - t0 or d % 2 != (t1 - t0) % 2: +    t0, x0, y0 = t1, x1, y1