N = int(eval(input()))

T = 0

X = 0

Y = 0

ans = 'Yes'

for i in range(N):

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

  if abs(X-x)+abs(Y-y)>abs(T-t) or (((X-x)+(Y-y))-(T - t))%2==1:

    ans = 'No'

  else:

    T = t

    X = x

    Y = y

    

print(ans)
N = int(eval(input()))

xc, yc, tc = 0, 0, 0

ans = 'Yes'

for i in range(N):

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

  if (t - tc - abs(x-xc) - abs(y-yc)) % 2 == 0 and t - tc - abs(x-xc) - abs(y-yc) >= 0:

    xc, yc, tc = x, y, t

  else:

    ans = 'No'

    break

print(ans)

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

N = int(eval(input()))
xc, yc, tc = 0, 0, 0
ans = "Yes"
for i in range(N):
    t, x, y = list(map(int, input().split()))
    if (t - tc - abs(x - xc) - abs(y - yc)) % 2 == 0 and t - tc - abs(x - xc) - abs(
        y - yc
    ) >= 0:
        xc, yc, tc = x, y, t
    else:
        ans = "No"
        break
print(ans)

-T = 0 -X = 0 -Y = 0 +xc, yc, tc = 0, 0, 0 -    if abs(X - x) + abs(Y - y) > abs(T - t) or (((X - x) + (Y - y)) - (T - t)) % 2 == 1: +    if (t - tc - abs(x - xc) - abs(y - yc)) % 2 == 0 and t - tc - abs(x - xc) - abs( +        y - yc +    ) >= 0: +        xc, yc, tc = x, y, t +    else: -    else: -        T = t -        X = x -        Y = y +        break