peterverebics/CodeNet_Python_118 huggingface dataset:
n=int(input())
txy=[list(map(int,input().split())) for _ in range(n)]
txy.insert(0,[0,0,0])
for i in range(n):
  d=abs(txy[i+1][1]-txy[i][1])+abs(txy[i+1][2]-txy[i][2])
  t=txy[i+1][0]-txy[i][0]
  if t-d<0 or d%2==0:
    print("No")
    exit()
print("Yes")
N=int(input())
tl=[]
xl=[]
yl=[]
al=[]
bl=[]
cl=[]
dl=[]

for i in range(N):
 t,x,y=map(int,input().split())
 tl.append(t)
 xl.append(x)
 yl.append(y)
 al.append((x+y)%2)
 bl.append(t%2)
 print(x)
for i in range(N):
 c=abs((xl[i]+yl[i])-(xl[i-1]+yl[i-1]))
 d=tl[i]-tl[i-1]
 cl.append(c)
 dl.append(d)

if al==bl and (xl+yl)<=tl and cl<=dl:
 print("Yes")
else :
  print("No")
N = int(input())
T = []
XY = []


def f(x1, y1, x2, y2):
    return abs(x1 - x2) + abs(y1 - y2)


print('No')
exit()

cx, cy = 0, 0
ct = 0
for _ in range(N):
    t, x, y = map(int, input().split())
    d = f(cx, cy, x, y)
    if d > t - ct:
        print('No')
        exit()
    if (t - ct - d) % 2 != 0:
        print('No')
        exit()
print('Yes')
import sys
n = int(input())
pos = [list(map(int,input().split())) for p in range(n)]
for i in range(len(pos)):
  if i == 0:
    if pos[i][1]+pos[i][2] != pos[i][0]:
      print("No")
      sys.exit()
  else:
    diff = pos[i][0]-pos[i-1][0]
    num = abs(pos[i][1]-pos[i-1][1]) + abs(pos[i][2]-pos[i-1][2])
    if num <= diff and diff * (diff%2) == num%2:
      pass
    else:
      print("No")
      sys.exit()      
print("Yes")
n = int(input())

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

nx = 0
ny = 0
nt = 0
for _ in range(N):
    t, x, y = map(int, input().split())
    k = abs(nx-x)+abs(ny-y)
    if k > t:
        print("No")
        break
    if (k-t)%2 != 0:
        print("No")
        break
    nx = x
    ny = y
    nt = t
else:
    print("Yes")
import sys
input = sys.stdin.readline
n=int(input())

t1,x1,y1=0,0,0
flg=True
for i in range(n):
    t2,x2,y2=map(int,input().split())
    l=abs(x2-x1)+abs(y2-y1)
    print(l,t2-t1)
    if l<=(t2-t1) and (t2-t1-l-1)%2==0:
        t1,x1,y1=t2,x2,y2
    else:
        flg=False
        break
print("Yes" if flg else "No")
n = int(input())
lst = [list(map(int, input().split())) for _ in range(n)]

ans = 'No'

for line in lst:
    t, x, y = line
    if t < x + y:
        break
    if t % 2 == 0 and x + y % 2 != 0:
        break
    if t % 2 != 0 and x + y % 2 == 0:
        break
    
    if t - x - y % 2 == 0:
        ans = 'Yes'

print(ans)
N=int(input())
des=[list(map(int,input().split())) for _ in range(N)]
des.insert(0,[0,0,0])
for i in range(N):
    time=des[i+1][0]-des[i][0]
    d_x=abs(des[i+1][1]-des[i][1])
    d_y=abs(des[i+1][2]-des[i][2])
    if (time-(d_x+d_y))%2!=0 and time>=(d_x+d_y):
        print("No")
        exit()
print("Yes")
N = int(input())
TXY = [list(map(int, input().split())) for _ in range(N)]
 
pre_t, pre_x, pre_y = 0, 0, 0
for t, x, y in TXY:
  diff_t = t - pre_t
  diff_pos = abs(x-pre_x) + abs(y-pre_y)
  if diff_t < diff_pos or diff_t - diff_pos % 2 == 1:
    print('No')
    exit()
  else:
    pre_t, pre_x, pre_y = t, x, y
print('Yes')
N=int(input())
t0=0
x0=0
y0=0

for i in range(N):
  t1,x1,y1=map(int,input().split())
  AbsT=t1-t0
  AbsX=abs(x1-x0)
  AbsY=abs(y1-y0)
  if AbsX+AbsY>AbsT or (AbsX+AbsY-AbsT)%2!=0:
    print("No")
    break

else:
  print("Yes")
n = int(input())
l = [list(map(int, input().split())) for _ in range(n)]

x = y = t = 0
for i in range(n):
    dx, dy, dt = l[i][1], l[i][2], l[i][0]
    dist = abs((dx - x) + (dy - y))

    if abs(dt - t) < dist or dt - dist:
        print("No")
        exit()

    x, y, t = dx, dy, dt
print("Yes")
N = int(input())
cs = []
t1, x1, y1 = 0, 0, 0
ans = 'Yes'
for i in range(N):
  t2, x2, y2 = map(int, input().split())
  d = abs(x1-x2) + abs(y1-y2)
  if d == 0 or d > (t2 - t1) or d % 2 != (t2 - t1) % 2:
    ans = 'No'
    break
print(ans)
N = int(input())
cs = []
t1, x1, y1 = 0, 0, 0
ans = 'Yes'
for i in range(N):
  t2, x2, y2 = map(int, input().split())
  d = abs(x1-x2) + abs(y1-y2)
  if d > (t2 - t1) or d % 2 != (t2 - t1) % 2:
    ans = 'No'
print(ans)
c = input()
data = []
for s in range(0,int(c)):
  data.append(list(map(int, input().split())) )

nexttime = 0
nextx = 0
nexty = 0


for s in range(0, len(data)):
  nexttime = data[s][0]
  nextx = data[s][1]
  nexty = data[s][2]
  if ( (nexttime < nextx+nexty) or ((((nextx + nexty) ) % 2) != (nexttime % 2) ) ):
    print("NO")
    exit()


print("YES")
N = int(input())
pt, px, py = 0, 0, 0
can = True
for i in range(N):
    t, x, y = map(int, input().split())
    T, X, Y = t - pt, abs(x - px), abs(y - py)
    if T < X + Y or T % 2 != (X + Y) % 2:
        can = False
print('Yes' if can else 'No')
n=int(input())
for i in range(n):
  t,x,y=map(int,input().split())
  if x + y > t or (x+y)%2!=t%2:
    print("No")
    break
else:
  print("Yes")
N=int(input())

for i in range(N):
    t,x,y = map(int,input().split())
    if ((x+y+t)%2 != 0) & ((x+y)<t):
        print("No")
        exit()
print("Yes")
N=int(input())

for i in range(N):
    t,x,y = map(int,input().split())
    if ((x+y+t)%2 != 0) & (abs(x+y)>t):
        print("No")
        exit()
print("Yes")
N = int(input())


def f(x1, y1, x2, y2):
    return abs(x1 - x2) + abs(y1 - y2)


pt = 0
cx, cy = 0, 0
for _ in range(N):
    t, x, y = map(int, input().split())
    d = f(cx, cy, x, y)
    if t - pt < d:
        print('No')
        exit()
    if (t - pt - d) % 2 != 0:
        print('No')
        exit()
print('Yes')

# 最短距離にかかる time + 2 * i ならいける
n=int(input())
txy=[list(map(int,input().split())) for _ in range(n)]
txy.insert(0,[0,0,0])
for i in range(n):
  d=abs(txy[i+1][1]-txy[i][1])+abs(txy[i+1][2]-txy[i][2])
  if ((txy[i+1][0]-txy[i][0])-d)<0:
    print("No")
    exit()
  elif d%2==0:
    print("No")
    exit()
print("Yes")
N = int(input())
cs = []
t1, x1, y1 = 0, 0, 0
ans = 'Yes'
for i in range(N):
  t2, x2, y2 = map(int, input().split())
  d = abs(x1-x2) + abs(y1+y2)
  if d > (t2 - t1) or d % (t2 - t1):
    ans = 'No'
print(ans)
N = int(input())
nowt = 0
nowx = 0
nowy = 0
for i in range(N):
  t, x, y = map(int, input().split())
  ti = t - nowt
  xi = x - nowx
  yi = y - nowy
  if ti < abs(xi) + abs(yi):
    print('No')
    exit()
  if ti%2 != (xi+yi)%2:
    print('No')
    exit()
    
print('Yes')
n=int(input())
txy=[list(map(int,input().split())) for _ in range(n)]
txy.insert(0,[0,0,0])
for i in range(1,n+1):
  d=abs(txy[i][1]-txy[i-1][1])+abs(txy[i][2]-txy[i-1][2])
  if ((txy[i][0]-txy[i-1][0])-d)<0:
    print("No")
    exit()
  elif d%2==0:
    print("No")
    exit()
print("Yes")
N = int (input ())
t2 = 0
x2 = 0
y2 = 0
for i in range (N):
    t,x,y = map(int, input().split())
    if abs (t-t2) >= abs ((x-x2)+(y-y2)):
        if (round (((t-t2)-((x-x2)+(y-y2)))/2))*2 ==((t-t2)-((x-x2)+(y-y2))):
            ans = 'YES'
        else:
            ans = 'NO'
            break
    else:
        ans = 'NO'
        break
    t2 = t
    x2 = x
    y2 = y
print (ans)
N = int(input())
plan = [list(map(int, input().split())) for i in range(N)]
m = 0
for i in range(N-1):
    time = plan[i+1][0]-plan[i][0]
    dist = abs(plan[i+1][1]-plan[i][1])+abs(plan[i+1][2]-plan[i][2])
    if time == 0:
      m = 1
      break
    if dist>time:
      m = 1
      break
    if dist%2 != time%2:
      m = 1
      break
print('Yes' if m==0 else 'No')
n = int(input())
pos = [list(map(int, input().split())) for _ in range(n)]

def func(n, pos):
    c_t, c_x, c_y = 0, 0, 0

    for i in pos:
        d_t = i[0] - c_t
        z = (i[1] - c_x) + (i[2] - c_y)

        if z > d_t or (d_t - z) % 2 != 0:
            return "No"
        else:
            c_t, c_x, c_y = i[0], i[1], i[2]

    return "Yes"


print(func(n, pos))
c = input()
data = []
for s in range(0,int(c)):
  data.append(list(map(int, input().split())) )

nowtime = 0
nowx = 0
nowy = 0

nexttime = 0
nextx = 0
nexty = 0

costtime = 0
diffx = 0
diffy = 0

for s in range(0, len(data)):
  nexttime = data[s][0]
  nextx = data[s][1]
  nexty = data[s][2]
  costtime = nexttime - nowtime
  diffx = abs(nextx - nowx)
  diffy = abs(nexty - nowy)
  if ( (costtime < diffx + diffy) or ((((nextx + nexty) ) % 2) == (nexttime % 2) ) ):
    print("NO")
    exit()
  nowtime = nexttime
  nowx = nextx
  nowy = nexty



print("YES")
N = int(input())
s = [[0,0,0]]
for i in range(N):
    s.append(list(map(int,list(input().split()))))
err = 0
for i in range(N):
    dt = s[i+1][0] - s[i][0]
    dist = abs(s[i+1][1] - s[i][1]) + abs(s[i+1][2] - s[i][2])
    if(dt < dist):
        err = 1
    if(dist % 2 != dt % 2):
        err = 1

if(err == 0):
    print("YES")
else:
    print("NO")
N = int(input())
xy=[]
try :
  while True:
    t = input().split()
    t = list(map(int,t))
    xy.append(t)
except EOFError:
  pass
loc = [0,0]
time = 0
for i in range(N):
  a = xy[i]
  time = a[0]-time
  dis = abs(loc[0]-a[1])+abs(loc[1]-a[2])
  if (time-dis)<0 :
    print("No")
    break
  elif (time-dis)%2 == 0:
    loc = [a[1],a[2]]
    
  else :
    print("No")
    break
else :
  print("Yes")
n = int(input())
 
for _ in range(n):
    t, x, y = map(int, input().split())
    if  x + y > t or (t - x - y) % 2:
        print("No")
        exit()
print("Yes")
N = int(input())
st = 0
sx = 0
sy = 0
flg = False
for _ in range(N):
    t,x,y = map(int,input().split())

    if (x+y)-(sx+sy) > (t-st) or (t-st) % 2 != ((x+y)-(sx+sy)) % 2:
        flg = True
        break
    else:
        st = t
        sx = x
        sy = y
print('No' if flg else 'Yes')
n = int(input())
pret = 0
prex = 0
prey = 0
flag = True
for i in range(n):
    t,x,y = map(int,input().split())
    if flag:
        tmp = t - x - y - pret + prex + prey
        #print(t, x, y, tmp)
        if tmp >= 0 and tmp % 4 == 0:
            pret = t
            prex = x
            prey = y
        else:
            flag = False
if flag:
    print('Yes')
else:
    print('No')
n = int(input())

for i in range(n):
  t,x,y = map(int,input().split())
  if (x + y) > t or (x + y + t) % 2:
    print("No")
    exit()
  print("Yes")
N = int(input())
prev_t = 0
for i in range(N):
    t,x,y = map(int, input().split())
    if (x+y) > t - prev_t or (x+y)%2 != t%2:
        print('No')
        exit()
    prev_t = t
print('Yes')
N = int(input())
L = [list(map(int, input().split())) for i in range(N)]

l = [[0, 0, 0]]
l.extend(L)

flag = True
for c in range(1, len(L)):
    dt = l[c][0] - l[c-1][0]
    dist = abs(l[c][1] - l[c-1][1]) + abs(l[c][2] - l[c-1][2])

    if dist > dt or dist % 2 != dt % 2:
        flag = False

print("YES" if flag else "NO")
n = int(input())
ans = 'Yes'
pre_t = 0
pre_d = 0

for _ in range(n):
  a,b,c = map(int,input().split())
  t = a - pre_t
  d = abs((b+c) - pre_d)
  if (t%2) == 0 and (d%2) == 0 and t >= d:
    continue
  elif (t%2) != 0 and (d%2) != 0 and t >= d:
    continue
  else:
    ans = 'No'
    break
  pre_t = t
  pre_d = d

print(ans)
n=int(input())
for i in range(n):
 z,x,y=map(int, input().split())
 dist=abs(z+1-z)
 dt=abs(x+1-x)+abs(y+1-y)
 if dist<z or (dist%2) != (dt%2):
  print("No")
  exit()
  
print("Yes")
import sys
n = int(input())
pos = [list(map(int,input().split())) for p in range(n)]
for i in range(len(pos)-1):
  diff = pos[i+1][0]-pos[i][0]
  num = abs(pos[i][1]-pos[i+1][1]) + abs(pos[i][2]-pos[i+1][2])
  if diff%2 == num%2 and num <= diff ** (diff%2) :
    pass
  else:
    print("No")
    sys.exit()      
print("Yes")
N = int(input())
t, n = [], []
for i in range(N):
    temp = list(map(int, input().split()))
    t.append(temp[0])
    n.append(abs(temp[1]) + abs(temp[2]))
    
nowTime, nowPoint = 0, 0
f = True
for i in range(N):
    time, point = t[i]-nowTime, n[i]-nowPoint
    if time%2 != point%2:
        f = False
        break
    if time < point:
        f = False
        break
    nowTime, nowPoint = t[i], n[i]
    
if f:
    print('Yes')
else:
    print('No')
n = int(input())

ans = True
for i in range(n):
    t,x,y = map(int,input().split())
    if (x+y)%2 != t%2:
        ans = False

if ans:
    print("Yes")
else:
    print("No")
n = int(input())
curx, cury = 0, 0
ans = 'Yes'
prev_t = 0
for _ in range(n):
   t, x, y = map(int, input().split())
   d = abs(x - curx) + abs(y - cury)
   if d > (t - prev_t) or (t - prev_t) % 2 != d % 2:
      ans = 'No'
      break
   prev_t = t

print(ans)
ans = "Yes"
N = int(input())
t = []
x = []
y = []
for i in range(N):
  tmp = input().split(" ")
  t.append(int(tmp[0]))
  x.append(int(tmp[1]))
  y.append(int(tmp[2]))

for j in range(N-1):
  dt = t[j+1] - t[j]
  dx = abs(x[j+1] - x[j])
  dy = abs(y[j+1] - y[j])
  if dt >= dx + dy and dt % 2 == (dx + dy) % 2:
    continue
  else:
    ans = "No"
    break

print(ans)
N = int(input())
now_t = 0
now_x = 0
now_y = 0
flag = 0
for i in range(N):
    t,x,y = map(int,input().split())
    if abs(x-now_x)+abs(y-now_y) %2 ==(now_t-t)%2:
        now_t = t
        now_x = x
        now_y = y
    else:
        flag += 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")
n = int(input())
for i in range(n):
    t,x,y = map(int, input().split())
    if (x + y) > t or (x + y + t) % 2:
        print("NO")
        exit()
print("YES")
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
for li in [rl() for _ in range(n)]:
    t, a, b = li
    if abs(t) < abs(a) + abs(b) or (t - a - b) & 1:
        print('No')
        exit()
print('Yes')
N = int(input())
plan = [list(map(int, input().split())) for i in range(N)]
f = True
for i in range(N-1):
    time = plan[i+1][0]-plan[i][0]
    dist = abs(plan[i+1][1]-plan[i][1])+abs(plan[i+1][2]-plan[i][2])
    if dist>time or dist%2 != time%2:
        f = False    
print('Yes' if f else 'No')
N=int(input())
t1 = 0
x1 = 0
y1 = 0
for i in range(N):
  t2,x2,y2=map(int,input().split())
  d = abs(x1 - x2) + abs(y1 - y2)
  dt = t2 - t1
  if d > dt:
    print('No')
    exit()
  if dt%2!=0 and d==0:
    print('No')
    exit()
  if dt%2==0 and d==1:
    print('No')
    exit()
  t1,x1,y1=t2,x2,y2
print('Yes')
N=int(input())
pre_t=0
pre_x=0
pre_y=0
flg=0
for i in range(N-1):
    t,x,y=map(int,input().split())
    t_tmp = t
    t=t-pre_t
    dist=abs(x-pre_x) + abs(y - pre_y)
    pre_t=t_tmp
    pre_x=x
    pre_y=y
    if(dist > t ):
        flg=1
        break
    if((dist)%2 != t%2):
        flg=1
        break
if(flg == 0):
    print("Yes")
else:
    print("No")
N = int(input())
x = [list(map(int, input().split())) for i in range(N)]
cnt = 0
sum = 0
flag = 0
for i in range(N):
    if i == 0:
        cnt = x[i][0]
        sum = x[i][1]
    else:
        cnt = x[i][0] - x[i-1][0]
        sum = abs(x[i][1]-x[i-1][1]) + abs(x[i][2]-x[i-1][2])
    if cnt < sum or cnt % 2 != sum % 2:
        flag = 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")
n = int(input())
prev_t = 0
for i in range(n):
    t, x, y=map(int, input().split())
    if (x + y) > (t - prev_t) or (x + y + (t - prev_t)) % 2:
        print("No")
        exit()
    prev_t = t
print("Yes")
n = int(input())
prev_t = 0
for i in range(n):
    t, x, y=map(int, input().split())
    if (x + y) > (t - prev_t) or (x + y + (t - prev_t)) % 2!=0:
        print("No")
        exit()
    prev_t = t
print("Yes")
n=int(input())
arr=[[0,0,0]]+[list(map(int,input().split())) for _ in range(n)]
for i in range(n):
  t1,x1,y1=arr[i]
  t2,x2,y2=arr[i+1]
  if abs(x1-x2)+abs(y1-y2)>t1+t2:
    print('No')
    exit()
  if (abs(x1-x2)+abs(y1-y2))%2!=(t1+t2)%2:
    print('No')
    exit()
print('Yes')
N = int(input())
[t, x, y] = [[],[],[]]
for i in range(N):
  input_line = list(map(int, input().split()))
  t.append(input_line[0])
  x.append(input_line[1])
  y.append(input_line[2])

can = True
for i in range(0, N-1):
  dt = t[i+1] - t[i]
  dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])
  if dt < dist:
    can = False
  if dt%2 != dist%2:
    can = False
  
if can == True:
  print("Yes")
else:
  print("No")
n = int(input())
t_ = 0
xy_ = [0,0]
for _ in range(n):
    t, *xy = map(int, input().split())
    ta = t - t_
    xya = [abs(xy[0]-xy_[0]), abs(xy[1]-xy_[1])]
    if sum(xya) > ta or (ta - sum(xya))%2 != 0:
        print("No")
        break
else:
    print("Yes")
N, *T = map(int, open(0).read().split())
d_t, d_x, d_y = 0, 0, 0
for t, x, y in zip(T[::3], T[1::3], T[2::3]):
    dist = abs(d_x - x) + abs(d_y - y)
    if (t - d_t - dist) % 2:
        print("No")
        break
    d_t, d_x, d_y = t, x, y
else:
    print("Yes")
import numpy as np
N = int(input())

txy = [[0,0,0]]
for i in range(N):
    txy.append(list(map(int,input().split())))

out='Yes'
for i in range(1,N+1):
    x = np.array(txy[i])
    y = np.array(txy[i-1])
    mv = x-y
    # print(mv)
    dam = mv[0] - (mv[1] + mv[2])
    if dam%2==1 or dam<0:
        out='No'

print(out)
N = int(input())
ti_xi_yi = [map(int, input().split(' ')) for n in range(N)]
for ti, xi, yi in ti_xi_yi:
    if not (xi+yi <= abs(ti) and abs(xi)+abs(yi) <= abs(ti) and ti%2 == (xi+yi)%2):
        print('No')
        exit()
print('Yes')
N=int(input())
x=y=t=0
flag=True
for i in range(N):
  ti, xi, yi = map(int, input().split())
  dist = abs(xi-x)+abs(yi-y)
  dt = ti-t
  x, y = xi, yi
  if dist<=dt and dist%2==dt%2:
    continue
  else:
    flag=False
print("Yes") if flag else print("No")
n = int(input())

x0, y0 = 0, 0

for _ in range(n):
  t, x, y = map(int, input().split())
  if abs(x-x0) + abs(y-y0) > t or (x+y)%2 != t%2:
    status = "No"
    break
  else:
    status = "Yes"
    x0, y0 = x, y
    
print(status)
N = int(input())

bt, bx, by = 0, 0, 0
flg = True
for i in range(N):
    t, x, y = map(int, input().split())
    dist = abs(x-bx)+abs(y-by)
    if t<bt:
        flg = False
        break
    time = t-bt
    if time>=dist and (time-dist)%2==0:
        bt, bx, xy = t, x, y
    else:
        flg = False
        break

if flg:
    print('Yes')
else:
    print('No')
n = int(input())

res = 0
for i in range(n):
  t, x, y = map(int, input().split())

  if x+y<=t-res and t%2==(x+y)%2:
    res = res+t-x-y
  else:
    print('No')
    exit()
    
print('Yes')
n = int(input())
t, x, y = 0, 0, 0
t1, x1, y1 = 0, 0, 0
p = False
for i in range(n):
	t, x, y = t1, x1, y1
	t1, x1, y1 = map(int, input().split())
	s = t1 - t
	d = x1 + y1 - x - y
	p = x >= 0 and y >= 0 and (abs(s) >= abs(d)) and ((s - d) % 2 == 0)
	print("{},{}".format(s, d))
	if p == False:
		break
print("Yes" if p else "No")
N = int(input())
t = [0] * N
x = [0] * N
y = [0] * N

for i in range(N):
    t[i], x[i], y[i] = map(int, input().split())

for n in range(N):
    if t[n] < abs(x[n]) + abs(y[n]) or (x[n] + y[n]) % 2 != t[n] % 2:
        print('No')
        exit()

print('Yes')
n=int(input())
a=[list(map(int,input().split())) for _ in range(n)]
x=y=t=0
ans='Yes'
for i in range(n):
  xy=a[i][1]+a[i][2]-(x+y)
  if xy>a[i][0]-t:
    ans='No'
    break
  else:
    if xy%2!=(a[i][0]-t)%2:
      ans='No'
      break
print(ans)
N=int(input())

for i in range(N):
    t,x,y = map(int,input().split())
    z=t+x+y
    if (z>2*t) or (z%2 != 0):
        print("No")
        exit()
print("Yes")
n=int(input())

num,a,b=0,0,0

for i in range(n):
  t,x,y=map(int,input().split())
  num,a,b=abs(t-num),abs(x-a),abs(y-b)
  su=a+b
  if num<=su:
    ans="No"
    break
  elif su==0 and num%2==0:
    ans="Yes"
    break
  elif su==0 and num%2!=0:
    ans="No"
    break
  else:
    if num%2 != su%2:
      ans="No"
    else:
      ans="Yes"
      
print(ans)
N = int(input())
pt, px, py = 0, 0, 0
for _ in range(N):
    ct, cx, cy = map(int, input().split())
    diff_t = ct-pt
    diff_x = cx - px
    diff_y = cy - py

    diff_xy = abs(diff_x+diff_y)
    if diff_xy > diff_t:
        print('No')
        exit()
    if (diff_xy + diff_t) % 2 == 0:
        print('No')
        exit()

    px = cx
    py = cy
    pt = ct

print('Yes')
n=int(input())
T,X,Y=0,0,0

a='Yes'
for i in range(n):
    t,x,y=map(int,input().split())
    if abs(x-X)+abs(y-Y)>t-T or t%2!=(x+y)%2:
        a='NO'
        break
    T,X,Y=t,x,y
print(a)
n = int(input())
t,x,y = map(int,input().split())

No = 0

for i in range(n):
  if (x + y) > t or (x + y + t) % 2 == 1:
    No = No + 1

if No == 0:
  print("Yes")
else:
  print("No")
N=int(input())

t0=0
x0=0
y0=0

ans=True
for i in range(N):
    t,x,y=map(int,input().split())
    l=(t-t0)-abs(x+y-x0-y0)
    if l%2==0 and l>=0:
        continue
    else:
        ans=False

if ans==True:
    print("Yes")
else:
    print("No")
N = int(input())
now_t = 0
now_x = 0
now_y = 0
flag = 0
for i in range(N):
    t,x,y = map(int,input().split())
    if abs(x-now_x)+abs(y-now_y)<= t and (abs(x-now_x)+abs(y-now_y))%2 == abs(t-now_t)%2:
        now_t = t
        now_x = x
        now_y = y
    else:
        flag += 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")
n = int(input())
apple = []
for _ in range(n):
    apple.append(list(map(int, input().split())))
a = [0, 0]
count = 0
for i in apple:
    t = i[0]
    b = i[1:]
    if abs(b[0]) + abs(b[1]) <= t:
        if (abs(b[0]) + abs(b[1]))%2 == t%2:
            count += 1
        else:
            count = 0
            break
    else:
        count = 0
        break
print("Yes" if count == n else "No")
n = int(input())
flag = True
for i in range(n):
    t,x,y=map(int,input().split())
    if x + y <= t and (x + y) % 2 == t % 2:
        print("Yes")
        flag = False
        break
if flag:
    print("No")
N = int(input())
t = [0] * (N + 1)
x = [0] * (N + 1)
y = [0] * (N + 1)
for i in range(N):
    t[i + 1], x[i + 1], y[i + 1] = map(int, input().split())

for i in range(N):
    dt = t[i + 1] - t[i]
    dist = abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i])
    if dt < dist:
        print("NO")
        exit(0)

    if dist % 2 != dt % 2:
        print("NO")
        exit(0)

print("YES")
n=int(input())
x,y=0,0
t=0
for i in range(n):
    X,Y,T=map(int,input().split())
    if((T-t)>=(abs(X-x)+abs(Y-y)) and (T-t)%2==(abs(x-X)+abs(Y-y))%2):
        x=X
        y=Y
        t=T
    else:
        print("No")
        exit()
print("Yes")
N = int(input())
xy=[]
try :
  while True:
    t = input().split()
    t = list(map(int,t))
    xy.append(t)
except EOFError:
  pass
loc = [0,0]
time = 0
for i in range(N):
  a = xy[i]
  time = a[0]-time
  dis = abs(loc[0]-a[1])+abs(loc[1]-a[2])
  if (time-dis)<0 :
    print("No")
    exit()
  elif (time-dis)%2 == 1:
    print("No")
    exit()
    
    
  else :
    loc = [a[1],a[2]]
    
  
else :
  print("Yes")
N = int(input())
plan = [list(map(int, input().split())) for i in range(N)]
f = True
for i in range(N-1):
    time = plan[i+1][0]-plan[i][0]
    dist = abs(plan[i+1][1]-plan[i][1])+abs(plan[i+1][2]-plan[i][2])
    if dist>time or (dist%2 != time%2):
        f = False    
print('Yes' if f else 'No')
N = int(input())

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

x0 = 0
y0 = 0
t0 = 0
res = "Yes"
for t, x, y in pairs:
    dx = x - x0
    dy = y - y0
    dt = t - t0

    # if abs(dx) + abs(dy) != dt:
    tmp = dt - (abs(dx) + abs(dy))
    if tmp <= 0 or tmp % 2 != 0:
        res = "No"
        break
    x0 = x
    y0 = y
    t0 = t

print(res)
N = int(input()) 
P = [list(map(int, input().split())) for i in range(N)] 
P.insert(0,[0,0,0])

ans = "YES"
for i in range(N):
	norm = abs(P[i+1][1]-P[i][1])+abs(P[i+1][2]-P[i][2])
	if (P[i+1][0]-P[i][0])%2 != norm%2:
		ans = "NO"
		break
	#else:
	#	if norm %2 == 0:
	#	ans = "NO"
	#		break
	
print(ans)
n = int(input())
t1 = 0
x1 = 0
y1 = 0
count = 0
for _ in range(n):
    t,x,y = map(int,input().split())
    t = abs(t - t1)
    x = abs(x - x1)
    y = abs(y - y1)
    if x + y <= t and x+y % 2 == t % 2:
        t1 = t
        x1 = x
        y1 = y
        count += 1
if count == n:
    print("YES")
else:
    print("NO")
N=int(input())
t=[]
x=[]
y=[]
flag=False
for i in range(N):
  t1,x1,y1=[int(i) for i in input().split()]
  t.append(t1)
  x.append(x1)
  y.append(y1)
for i in range(N):
  if(i>0):
    t[i]=t[i]-t[i-1]
    x[i]=x[i]-x[i-1]
    y[i]=y[i]-y[i-1]

for i in range(N):
  if((x[i]+y[i])%2==t[i] or abs(x[i])+abs(y[i])<=t[i]):
    flag=True
  else:
    flag=False
    break
if(flag):
  print("Yes")
else:
  print("No")