t, x, y = 0, 0, 0

for i in range(int(eval(input()))):

    next_t, next_x, next_y = list(map(int, input().split()))

    diff = abs(x - next_x) + abs(y - next_y)

    if diff > (next_t - t) or (diff - (next_t - t)) % 2 == 1:

        print("No")

        exit(0)

    t, x, y, = next_t, next_x, next_y

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

for __ in range(N):

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

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

        print("No")

        exit(0)



print("Yes")
t, x, y = 0, 0, 0
for i in range(int(eval(input()))):
    next_t, next_x, next_y = list(map(int, input().split()))
    diff = abs(x - next_x) + abs(y - next_y)
    if diff > (next_t - t) or (diff - (next_t - t)) % 2 == 1:
        print("No")
        exit(0)
    t, x, y, = (
        next_t,
        next_x,
        next_y,
    )
print("Yes")

N = int(eval(input()))
for __ in range(N):
    t, x, y = list(map(int, input().split()))
    if (x + y) > t or (x + y + t) % 2 == 1:
        print("No")
        exit(0)
print("Yes")

-t, x, y = 0, 0, 0 -for i in range(int(eval(input()))): -    next_t, next_x, next_y = list(map(int, input().split())) -    diff = abs(x - next_x) + abs(y - next_y) -    if diff > (next_t - t) or (diff - (next_t - t)) % 2 == 1: +N = int(eval(input())) +for __ in range(N): +    t, x, y = list(map(int, input().split())) +    if (x + y) > t or (x + y + t) % 2 == 1: -    t, x, y, = ( -        next_t, -        next_x, -        next_y, -    )