n = int(eval(input()))

plcs = [list(map(int,input().split())) for _ in range(n)]

A = [0, 0, 0]

for i in range(n):

    A = [plcs[i][j] - A[j] for j in range(3)]

    if A[0] >= abs(A[1]) + abs(A[2]) and plcs[i][0] % 2 == (abs(plcs[i][1]) + abs(plcs[i][2])) % 2:

        continue

    else:

        print('No')

        exit()

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

TP = [[0, 0, 0]]

for _ in range(n):

    TP.append(list(map(int, input().split())))

for i in range(1, n + 1):

    td = TP[i][0] - TP[i-1][0]

    pd = abs(TP[i][1] - TP[i-1][1]) + abs(TP[i][2] - TP[i-1][2])

    if td >= pd and td % 2 == pd % 2:

        continue

    else:

        print('No')

        exit()

print('Yes')
n = int(eval(input()))
plcs = [list(map(int, input().split())) for _ in range(n)]
A = [0, 0, 0]
for i in range(n):
    A = [plcs[i][j] - A[j] for j in range(3)]
    if (
        A[0] >= abs(A[1]) + abs(A[2])
        and plcs[i][0] % 2 == (abs(plcs[i][1]) + abs(plcs[i][2])) % 2
    ):
        continue
    else:
        print("No")
        exit()
print("Yes")

n = int(eval(input()))
TP = [[0, 0, 0]]
for _ in range(n):
    TP.append(list(map(int, input().split())))
for i in range(1, n + 1):
    td = TP[i][0] - TP[i - 1][0]
    pd = abs(TP[i][1] - TP[i - 1][1]) + abs(TP[i][2] - TP[i - 1][2])
    if td >= pd and td % 2 == pd % 2:
        continue
    else:
        print("No")
        exit()
print("Yes")

-plcs = [list(map(int, input().split())) for _ in range(n)] -A = [0, 0, 0] -for i in range(n): -    A = [plcs[i][j] - A[j] for j in range(3)] -    if ( -        A[0] >= abs(A[1]) + abs(A[2]) -        and plcs[i][0] % 2 == (abs(plcs[i][1]) + abs(plcs[i][2])) % 2 -    ): +TP = [[0, 0, 0]] +for _ in range(n): +    TP.append(list(map(int, input().split()))) +for i in range(1, n + 1): +    td = TP[i][0] - TP[i - 1][0] +    pd = abs(TP[i][1] - TP[i - 1][1]) + abs(TP[i][2] - TP[i - 1][2]) +    if td >= pd and td % 2 == pd % 2: