n = int(eval(input()))

txy = [[int(0)] * 3]

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



for i in range(n):

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

    xy_diff = (txy[i+1][1] + txy[i+1][2]) - (txy[i][1] + txy[i][2])



    if t_diff % 2 != xy_diff % 2 or xy_diff > t_diff:

        print("No")

        exit()



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

for i in range(n):

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



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

        print("No")

        exit()



print("Yes")
n = int(eval(input()))
txy = [[int(0)] * 3]
txy += [list(map(int, input().split())) for i in range(n)]
for i in range(n):
    t_diff = txy[i + 1][0] - txy[i][0]
    xy_diff = (txy[i + 1][1] + txy[i + 1][2]) - (txy[i][1] + txy[i][2])
    if t_diff % 2 != xy_diff % 2 or xy_diff > t_diff:
        print("No")
        exit()
print("Yes")

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

-txy = [[int(0)] * 3] -txy += [list(map(int, input().split())) for i in range(n)] -    t_diff = txy[i + 1][0] - txy[i][0] -    xy_diff = (txy[i + 1][1] + txy[i + 1][2]) - (txy[i][1] + txy[i][2]) -    if t_diff % 2 != xy_diff % 2 or xy_diff > t_diff: +    t, x, y = list(map(int, input().split())) +    if (t + x + y) % 2 == 1 or (x + y) > t: