N = int(eval(input()))

tm_pos = [list(map(int, input().split())) for i in range(N)]

for i in tm_pos:

    if i[0] < i[1] + i[2] or i[0] % 2 != (i[1] + i[2]) % 2:

        print('No')

        exit()

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

count = 0

T, X, Y = 0, 0, 0

for i in range(N): 

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

    if abs(x-X)+abs(y-Y) <= t-T and t % 2 == (x+y) % 2: 

        count += 1 

    T, X, Y = t, x, y

print(("Yes" if count == N else "No"))
N = int(eval(input()))
tm_pos = [list(map(int, input().split())) for i in range(N)]
for i in tm_pos:
    if i[0] < i[1] + i[2] or i[0] % 2 != (i[1] + i[2]) % 2:
        print("No")
        exit()
print("Yes")

N = int(eval(input()))
count = 0
T, X, Y = 0, 0, 0
for i in range(N):
    t, x, y = list(map(int, input().split()))
    if abs(x - X) + abs(y - Y) <= t - T and t % 2 == (x + y) % 2:
        count += 1
    T, X, Y = t, x, y
print(("Yes" if count == N else "No"))

-tm_pos = [list(map(int, input().split())) for i in range(N)] -for i in tm_pos: -    if i[0] < i[1] + i[2] or i[0] % 2 != (i[1] + i[2]) % 2: -        print("No") -        exit() -print("Yes") +count = 0 +T, X, Y = 0, 0, 0 +for i in range(N): +    t, x, y = list(map(int, input().split())) +    if abs(x - X) + abs(y - Y) <= t - T and t % 2 == (x + y) % 2: +        count += 1 +    T, X, Y = t, x, y +print(("Yes" if count == N else "No"))