n = int(eval(input()))

txy = [[0,0,0] if i==0 else list(map(int,input().split())) for i in range(n+1)]



flag = True

for i in range(n):

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

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

	dif = time - dist

	if dif<0 or dif%2==1:			# 到達不可能

		flag = False

		break



print(('Yes' if flag else 'No'))

n = int(eval(input()))

c = [0,0,0]

for i in range(n):

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

    time = t-c[0]

    coor = abs(c[1]-x)+abs(c[2]-y)

    if not (time>=coor and coor%2==time%2):

        print('No')

        exit()

    c = [t,x,y]

print('Yes')

n = int(eval(input()))
txy = [[0, 0, 0] if i == 0 else list(map(int, input().split())) for i in range(n + 1)]
flag = True
for i in range(n):
    dist = abs(txy[i][1] - txy[i + 1][1]) + abs(txy[i][2] - txy[i + 1][2])
    time = txy[i + 1][0] - txy[i][0]
    dif = time - dist
    if dif < 0 or dif % 2 == 1:  # 到達不可能
        flag = False
        break
print(("Yes" if flag else "No"))

n = int(eval(input()))
c = [0, 0, 0]
for i in range(n):
    t, x, y = list(map(int, input().split()))
    time = t - c[0]
    coor = abs(c[1] - x) + abs(c[2] - y)
    if not (time >= coor and coor % 2 == time % 2):
        print("No")
        exit()
    c = [t, x, y]
print("Yes")

-txy = [[0, 0, 0] if i == 0 else list(map(int, input().split())) for i in range(n + 1)] -flag = True +c = [0, 0, 0] -    dist = abs(txy[i][1] - txy[i + 1][1]) + abs(txy[i][2] - txy[i + 1][2]) -    time = txy[i + 1][0] - txy[i][0] -    dif = time - dist -    if dif < 0 or dif % 2 == 1:  # 到達不可能 -        flag = False -        break -print(("Yes" if flag else "No")) +    t, x, y = list(map(int, input().split())) +    time = t - c[0] +    coor = abs(c[1] - x) + abs(c[2] - y) +    if not (time >= coor and coor % 2 == time % 2): +        print("No") +        exit() +    c = [t, x, y] +print("Yes")