N = int(eval(input()))

T, X, Y = 0, 0, 0

cnt = 0

for _ in range(N):

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

  dist = abs(x-X) + abs(y-Y)

  dt = t - T

  cnt += all([dist <= dt, (dist - dt) % 2 == 0])

  T, X, Y = t, x, y

print(("YNeos"[N!=cnt::2]))

    
for _ in range(int(eval(input()))):

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

  if (t+x+y)%2 + (t<x+y):

    s = 1

    break

  s = 0

print(("YNeos"[s::2]))

    
N = int(eval(input()))
T, X, Y = 0, 0, 0
cnt = 0
for _ in range(N):
    t, x, y = list(map(int, input().split()))
    dist = abs(x - X) + abs(y - Y)
    dt = t - T
    cnt += all([dist <= dt, (dist - dt) % 2 == 0])
    T, X, Y = t, x, y
print(("YNeos"[N != cnt :: 2]))

for _ in range(int(eval(input()))):
    t, x, y = list(map(int, input().split()))
    if (t + x + y) % 2 + (t < x + y):
        s = 1
        break
    s = 0
print(("YNeos"[s::2]))

-N = int(eval(input())) -T, X, Y = 0, 0, 0 -cnt = 0 -for _ in range(N): +for _ in range(int(eval(input()))): -    dist = abs(x - X) + abs(y - Y) -    dt = t - T -    cnt += all([dist <= dt, (dist - dt) % 2 == 0]) -    T, X, Y = t, x, y -print(("YNeos"[N != cnt :: 2])) +    if (t + x + y) % 2 + (t < x + y): +        s = 1 +        break +    s = 0 +print(("YNeos"[s::2]))