N = int(eval(input()))

txy = [0]*(N+1)

txy[0] = [0, 0, 0]

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

    txy[i] = [int(i) for i in input().split()]



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

    dis = abs(txy[i][1] - txy[i-1][1]) + abs(txy[i][2] - txy[i-1][2])

    time = txy[i][0] - txy[i-1][0]

    if time < dis or (time - dis) % 2 != 0:

        print('No')

        break

else:

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

now = [0, 0, 0]



for i in range(N):

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

    dis = abs(x-now[0]) + abs(y - now[1])

    if (t - now[2]) < dis:

        print('No')

        break

    elif ((t - now[2]) - dis) % 2 != 0:

        print('No')

        break

else:

    print('Yes')

N = int(eval(input()))
txy = [0] * (N + 1)
txy[0] = [0, 0, 0]
for i in range(1, N + 1):
    txy[i] = [int(i) for i in input().split()]
for i in range(1, N + 1):
    dis = abs(txy[i][1] - txy[i - 1][1]) + abs(txy[i][2] - txy[i - 1][2])
    time = txy[i][0] - txy[i - 1][0]
    if time < dis or (time - dis) % 2 != 0:
        print("No")
        break
else:
    print("Yes")

N = int(eval(input()))
now = [0, 0, 0]
for i in range(N):
    t, x, y = list(map(int, input().split()))
    dis = abs(x - now[0]) + abs(y - now[1])
    if (t - now[2]) < dis:
        print("No")
        break
    elif ((t - now[2]) - dis) % 2 != 0:
        print("No")
        break
else:
    print("Yes")

-txy = [0] * (N + 1) -txy[0] = [0, 0, 0] -for i in range(1, N + 1): -    txy[i] = [int(i) for i in input().split()] -for i in range(1, N + 1): -    dis = abs(txy[i][1] - txy[i - 1][1]) + abs(txy[i][2] - txy[i - 1][2]) -    time = txy[i][0] - txy[i - 1][0] -    if time < dis or (time - dis) % 2 != 0: +now = [0, 0, 0] +for i in range(N): +    t, x, y = list(map(int, input().split())) +    dis = abs(x - now[0]) + abs(y - now[1]) +    if (t - now[2]) < dis: +        print("No") +        break +    elif ((t - now[2]) - dis) % 2 != 0: