n = int(eval(input()))

t = [0]

x = [0]

y = [0]

for i in range(n):

  ti, xi, yi = list(map(int, input().split()))

  t.append(ti)

  x.append(xi)

  y.append(yi)

  

ok = True

for i in range(n):

  ti = t[i+1] - t[i]

  if ((ti - (abs(x[i+1]-x[i]) + abs(y[i+1]-y[i]))) < 0

      or (ti - (abs(x[i+1]-x[i]) + abs(y[i+1]-y[i]))) % 2 != 0):

    ok = False

    break

if ok:

  print("Yes")

else:

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



pre_t, pre_x, pre_y = [0, 0, 0]

ok = True

for i in range(n):

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

  if (((t-pre_t) - (abs(x-pre_x) + abs(y-pre_y))) < 0

      or ((t-pre_t) - (abs(x-pre_x) + abs(y-pre_y))) % 2 != 0):

    ok = False

    break

  pre_t, pre_x, pre_y = [t, x, y]

  

if ok:

  print("Yes")

else:

  print("No")
n = int(eval(input()))
t = [0]
x = [0]
y = [0]
for i in range(n):
    ti, xi, yi = list(map(int, input().split()))
    t.append(ti)
    x.append(xi)
    y.append(yi)
ok = True
for i in range(n):
    ti = t[i + 1] - t[i]
    if (ti - (abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i]))) < 0 or (
        ti - (abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i]))
    ) % 2 != 0:
        ok = False
        break
if ok:
    print("Yes")
else:
    print("No")

n = int(eval(input()))
pre_t, pre_x, pre_y = [0, 0, 0]
ok = True
for i in range(n):
    t, x, y = list(map(int, input().split()))
    if ((t - pre_t) - (abs(x - pre_x) + abs(y - pre_y))) < 0 or (
        (t - pre_t) - (abs(x - pre_x) + abs(y - pre_y))
    ) % 2 != 0:
        ok = False
        break
    pre_t, pre_x, pre_y = [t, x, y]
if ok:
    print("Yes")
else:
    print("No")

-t = [0] -x = [0] -y = [0] -for i in range(n): -    ti, xi, yi = list(map(int, input().split())) -    t.append(ti) -    x.append(xi) -    y.append(yi) +pre_t, pre_x, pre_y = [0, 0, 0] -    ti = t[i + 1] - t[i] -    if (ti - (abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i]))) < 0 or ( -        ti - (abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i])) +    t, x, y = list(map(int, input().split())) +    if ((t - pre_t) - (abs(x - pre_x) + abs(y - pre_y))) < 0 or ( +        (t - pre_t) - (abs(x - pre_x) + abs(y - pre_y)) +    pre_t, pre_x, pre_y = [t, x, y]