peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())
D = [list(map(int, input().split())) for _ in range(N)]
for i in range(1, N - 1):
  t = D[i][0] - D[i - 1][0]
  d = D[i][1] - D[i - 1][1] + D[i][2] - D[i - 1][2]
  if t < d or t % 2 != d % 2:
    print('No')
    break
print('Yes')
N=int(input())
flag='Yes'
p,q,r=0,0,0
for _ in range(N):
  t,x,y=map(int,input().split())
  a=x+y-p-q
  e=t-r
  if a<=e:
    if (e-a)%2!=0:
      flag='No'
      break
  else:
    flag='No'
    break
  p=x
  q=y
  r=t
print(flag)
N = int(input())

t = [0]
x = [0]
y = [0]
for i in range(N):
    l = [int(c) for c in input().split()]
    t.append(l[0])
    x.append(l[1])
    y.append(l[2])

for i in range(N):
    move = x[i+1]-x[i] + y[i+1]-y[i]
    time = t[i+1]-t[i]
    if time%2 ^ move%2 == 1 or time < move:
        print("No")
        exit()

print("Yes")
import numpy

N=int(input())
S = numpy.zeros(N*3,dtype=int).reshape(N,3)
for i in range(N):
	S[i,:]= list(map(int,input().split()))

t=0
x=0
y=0
i=0
while i <N:
	L=(S[i,0]-t) - abs(S[i,1]-x) - abs(S[i,2]-y)
	if L<0:
		break
	elif L%2==0:
		t=S[i,0]
		x=S[i,1]
		y=S[i,2]
		i+=1
	else:
		break

if i ==N:
	print("YES")
else:
	print("NO")
N=int(input())

position=[[0,0,0]]
judge=[0]

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

for j in range(N):
    if ((position[1+j][1]+position[1+j][2]-position[1+j][0])%2 == 0) & (abs(x+y)<=t):
        judge.append(0)
    else:
        judge.append(1)

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

def check(t, x, y):
    for i in range(t + 1):
        for j in range(t + 1 - i):
            if i - j != x:
                break
            for k in range(t + 1 - i - j):
                if (i - j == x) and (k - (t - i - j - k)) == y:
                    return True
    return False

if all(check(l[0], l[1], l[2]) for l in [list(map(int, input().split())) for i in range(n)]):
    print('Yes')
else:
    print('No')
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%su==0:
      ans="Yes"
    else:
      ans="No"
      
print(ans)
def main():
    N = int(input())
    posi = [0, 0]
    time = 0
    txy = [[int(i) for i in input().split()] for _ in range(N)]
    for t, x, y in txy:
        move = abs(posi[0] - x) + abs(posi[1] - y)
        if (t - time) >= move and (move > 0 and (t - time) % move):
            return print("No")
        time = t
        posi = [x, y]
    print("Yes")


if __name__ == '__main__':
    main()
n = int(input())

data = []
data.append([0, 0, 0])
for i in range(n):
    t, x, y = map(int,  input().split())
    data.append([t, x, y])

for i in range(1, n + 1):
    if ( (data[i][0] - data[i - 1][0]) % 2 == 0 and (abs(data[i][1] - data[i - 1][1]) + abs(data[i][2] - data[i- 1][2]) % 2 != 0) or (data[i][0] - data[i - 1][0]) % 2 == 1 and (abs(data[i][1] - data[i - 1][1]) + abs(data[i][2] - data[i- 1][2]) % 2 != 1)):
        print("No")
        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 == 1:
    print("No")
    exit()
  print("Yes")
# -*- coding:utf-8 -*-
 
n = int(input())
t, x, y = [0], [0], [0]
for i in range(n):
  t_i, x_i, y_i = map(int, input().strip().split())
  t.append(t_i)
  x.append(x_i)
  y.append(y_i)
  
can = "YES"
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):
    can = "NO"
  if (dist % 2 != dt % 2):
    can = "NO"
print(can)
n = int(input())
nt, nx, ny = 0, 0, 0
for i in range(n):
    t, x, y = map(int, input().split())
    t = t-nt
    location = abs(nx-x) + abs(ny-y)
    if location <= t and (t-location)%2 == 0:
        nt, nx, ny = t, x, y
    else:
        print('No')
        exit()
print('Yes')
n = int(input())
for _ in range(n):
    t, x, y = map(int, input().split())
    if t < x + y:
        print('No')
        break
    else:
        if (t - x - y)%2 == 1:
            print('No')
            break
else:
    print('Yes')
N = int(input())
start = [0, 0]
start_t = 0
for i in range(N):
    t, x, y = map(int, input().split())
    now = [x, y]
    dt = t - start_t
    dist = abs(now[0]-start[0]) + abs(now[1]-start[1])
    if dist > dt or dt % 2 != dist % 2:
        print('No')
        break
else:
    print('Yes')
n=int(input())

start=[0,0,0]

ans=0

for i in range(n):
    
    cont=list(map(int,input().split()))
    
    if abs(start[0]-cont[0])!=abs(start[1]-cont[1])+abs(start[2]-cont[2]):
        print('No')
        ans=1
        
    start=cont
        
if ans==0:
    print('Yes')
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 (abs(xi+yi) <= ti and abs(xi)+abs(yi) <= ti and ti%2 == (xi+yi)%2):
        print('No')
        exit()
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 != pre_t%2):
        flg=1
        break
if(flg == 0):
    print("Yes")
else:
    print("No")
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)
    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())
posdata = [list(map(int,input().split())) for i in range(n)]
nowpos = [0,0,0]

for i in range(n):
    diff = posdata[i][1] - nowpos[1] + posdata[i][2] - nowpos[2]
    l_parity = diff % 2
    t_parity = posdata[i][0] % 2
    
    if diff > (posdata[i][0] - posdata[i - 1][0]) and l_parity == t_parity:
        nowpos = posdata[i]
        
    else:
        print("No")
        exit()
        
print("Yes")
N = int(input())
t=[0]*(N+1); x=[0]*(N+1); y=[0]*(N+1)
t_diff=0; x_diff=0; y_diff=0

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

# print(t, x, y)

for i in range(N):
    t_diff += t[i+1]-t[i]
    x_diff += x[i+1]-x[i]
    y_diff += y[i+1]-y[i]
    if t_diff%2 != (x_diff+y_diff)%2 or t[-1] <= (x[-1]+y[-1]):
        print("No")
        exit()

print("Yes")
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()
  t1,x1,y1=t2,x2,y2
print('Yes')
N = int(input())
TXY = [tuple(map(int,input().split())) for i in range(N)]
ct = cx = cy = 0
for t,x,y in TXY:
    d = abs(cx-x) + abs(cy-y)
    if d > t-ct or d%2 != (t-ct)%2:
        print('No')
        exit()
    ct,cx,xy = t,x,y
print('Yes')
import sys

N = int(input())
for i in sys.stdin:
    a = list(map(int, i.split(' ')))
    t = a[0]
    x = a[1]
    y = a[2]
    if (a[1] > N or a[2] > N):
        print('No')
        sys.exit(0)
    if ((x + y) > t + 1):
        print('No')
        sys.exit(0)
    if (t % 2 != (x + y) % 2):
        print('No')
        sys.exit(0)
print('Yes')
N=int(input())
tn,xn,yn=0,0,0
judge=[]
for i in range(N):
    t1,x1,y1=map(int,input().split())
    td=t1-tn
    xd=x1-xn
    yd=y1-yn
    if td%2==(xd+yd)%2 and td>=xd+yd:
        judge.append(True)
    else:
        judge.append(False)

    tn,xn,yn=t1,x1,y1
print('Yes' if all(judge) else 'No')
n = int(input())
found = True
for _ in range(n):
  t,x,y = map(int,input().split())
  if x==0 and y==0:
    if t&1:
      found = False
  elif x==0:
    if t%y == 0:
      m = t//y
      if (m&1) == 0:
        found = False
    else:
      found = False
  elif y==0:
    if t%x == 0:
      m = t//x
      if (m&1) == 0:
        found = False
    else:
      found = False
  else:
    if t%(x+y) != 0:
      found = False
print("Yes" if found 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())

for i in range(N):
    t,x,y = map(int,input().split())
    if ((x+y-t)%2 == 0) & (abs(x+y)<=t):
        continue
    else:
        print("No")
        exit()
print("Yes")
# -*- coding:utf-8 -*-

n = int(input())
t, x, y = [0], [0], [0]
for i in range(n):
  t_i, x_i, y_i = map(int, input().strip().split())
  t.append(t_i)
  x.append(x_i)
  y.append(y_i)
  
can = "YES"
for i in range(n):
  dt = t[i+1] - t[i]
  dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])
  can = "NO" if dt < dist else "YES"
  can = "NO" if dist % 2 != dt % 2 else "YES"
print(can)
prev = (0,0)
pt = 0
b = True

def f(a,b): return abs(b[0]- a[0]) + abs(b[1] - a[1])
for _ in range(int(raw_input())):
	t,x,y  = map(int, raw_input().split())
	if (t - pt) < f((x,y), prev):
		b = False
		break 
	prev,pt = (x,y),t

print 'Yes' if b else '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 sum(b) <= t:
        if sum(b)%2 == t%2:
            count += 1
        else:
            count = 0
            break
    else:
        count = 0
        break
print("Yes" if count == n else "No")
N = int(input())
P = [list(map(int,input().split())) for i in range(N)]
for tmp in P:
  t,x,y = tmp
  sum_ = x + y
  if t % 2 == 0 and sum_ % 2 == 0:
    print("Yes")
  elif t % 2 != 0 and sum_ % 2 != 0:
    print("Yes")
  else:
    print("No")
N = int(input())

ans = 'Yes'

tt, tx, ty = 0, 0, 0,
for _ in range(N):
    t, x, y = map(int, input().split())
    ct = t-tt
    cx = x-tx
    cy = y-ty
    if ct < (cx+cy):
        ans = 'No'
        break
    if cx+cy == 0:
        ans = 'No'
        break
    if ct%2 != (cx+cy)%2:
        ans = 'No'
        break
    tt, tx, ty = t, x, y

print(ans)
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, t = xi, yi, ti
  if dist<=dt and dist%2==dt%2:
    continue
  else:
    print(i,dist,dt)
    flag=False
print("Yes") if flag else print("No")
N = int(input())
t = [0]*100001
x = [0]*100001
y = [0]*100001
for n in range(N):
    t[n+1], x[n+1], y[n+1] = map(int, input().split())
ans = True
for n in range(1, N):
    dt   = t[n+1] - t[n]
    dist = (x[n+1] - x[n]) + (y[n+1] - y[n])
    if dt < dist:
        ans = False
    if dt % 2 != dist % 2:
        ans = False
if ans:
    print('Yes')
else:
    print('No')
n = int(input())
s = [map(int,input().split()) for i in range(n)]
t,x,y = (0,0,0)
for next_pos in s:
    t_next,x_next,y_next = next_pos
    dist = abs(x_next - x) + abs(y_next - y)
    if dist > t_next - t:
        print('No')
        break
    else:
        t,x,y = t_next,x_next,y_next
else:
    print('Yes')
N = int(input())
for _ in range(N):
    t,x,y = map(int, input().split())
    if (t+x+y)%2 or t<(x+y):
        print('No')
        exit()
print('Yes')
N = int(input())
txy = [[0,0,0] for i in range(N+1)]
for i in range(1,N+1):
    txy[i] = list(map(int,input().split()))

ans = 'Yes'
for i in range(1,N+1):
    dist = (txy[i][1]-txy[i-1][1])+(txy[i][2]-txy[i-1][2])
    dt   = txy[i][0]-txy[i-1][0]
    
    if dist%2 != dt%2 or dist>dt:
        ans = 'No'
        
print(ans)
N = int(input())
T,X,Y = 0,0,0

ans = "Yes"
for _ in range(N):
    t,x,y = map(int,input().split())
    t_need = abs(x - X) + abs(y - Y)
    if t - T < t_need:
        ans = "no"
        break
    if t - T > t_need:
        if ((t - T) - t_need) % 2 == 1:
            ans = "no"
            break
    T,X,Y = t,x,y

print(ans)
# AtCoder
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 = diff_x
    py = diff_y
    pt = diff_t

print('Yes')
import sys

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

for i in range(len(arr)-1):
    if arr[i+1][0]-arr[i][0] < abs(arr[i+1][1]-arr[i][1])+abs(arr[i+1][2]-arr[i][2]) or (arr[i+1][0]-arr[i][0])%2 != (abs(arr[i+1][1]-arr[i][1])+abs(arr[i+1][2]-arr[i][2]))%2:
        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]
for i in range(N):
  a = xy[i]
  time = a[0]
  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")
import sys
N = int(input())

for i in range(N):
    t, x, y = map(int, input().split())
    if (x + y)  > t or ((x + y + t)%2) != 0 :
        print('No')
        sys.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")
    break
  elif time%2 == dis%2:
    loc = [a[1],a[2]]
    
  else :
    print("No")
    break
else :
  print("Yes")
N = int(input())
scedule = []
scedule.append([0, 0, 0])
for i in range(N):
    scedule.append(list(map(int,input().split())))

print(scedule)

for i in range(N):
    timelimit = scedule[i+1][0] - scedule[i][0]
    x_distance = abs(scedule[i+1][1] - scedule[i][1])
    y_distance = abs(scedule[i+1][2] - scedule[i][2])

    if timelimit < (x_distance + y_distance):
        print("No")
        exit()
    if timelimit % (x_distance + y_distance) != 0:
        print("No")
        exit()

print("Yes")
N = int(input())
pt, px, py = 0, 0, 0

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

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

placeSequence = list()
for pivot in range(timeNum):
  placeSequence.append(list(map(int, input().split(' '))))

def compatibleCoordinate(time, x, y):
  if time % 2 == (abs(x) +  abs(y) % 2) and time >= abs(x) + abs(y):
    return True
  else:
    return False

time = x = y = 0

for place in placeSequence:
  objectTime, objectX, objectY = place
  flag = compatibleCoordinate(objectTime-time, objectX-x, objectY-y)
  if flag:
    time = objectTime
    x = objectX
    y = objectY
    continue
  else:
    print('No')
    break

else:
  print('Yes')
N = int(input())
t = []
x = []
y = []
for i in range(N):
  a,b,c = map(int, input().split())
  t.append(a)
  x.append(b)
  y.append(c)

def helper():
  curt = 0
  curx = 0
  cury = 0
  for i in range(N):
    dt = t[i] - curt
    curt = dt

    dx = abs(x[i] - curx)
    curx = x[i]

    dy = abs(y[i] - cury)
    cury = y[i]

    if dt < (dx+dy) or dt%2 != (dx+dy)%2:
      return False
  return True

a = helper()  
print('Yes') if a else print('No')
n = int(input())

No = 0

for i in range(n):
    t,x,y = map(int,input().split())
    if (x + y) > t or (x + y + t) % 2 == 1:
        No = No + 1
    else:
        No = No + 0

if No == 0:
    print("Yes")
else:
    print("No")
N = int(input())
txy = [[0, 0, 0]]
for i in range(N):
  txy.append(list(map(int, input().split())))

for i in range(N):
  dt = txy[i+1][0] - txy[i][0]
  dx = txy[i+1][1] - txy[i][1]
  dy = txy[i+1][2] - txy[i][2]
  
  if dt < dx + dy:
    print('No')
    break
  else:
    if (dt - (dx + dy)) % 2 != 0:
      print('No')
      break
else:
  print('Yes')
N = int(input())
txy = [[0, 0, 0]]
for i in range(N):
  txy.append(list(map(int, input().split())))

for i in range(N):
  dt = txy[i+1][0] - txy[i][0]
  dx = txy[i+1][1] - txy[i][1]
  dy = txy[i+1][2] - txy[i][2]
  print(dt, dx, dy, dt - (dx + dy))
  
  if dt < abs(dx + dy):
    print('No')
    break
  else:
    if (dt - (dx + dy)) % 2 != 0:
      print('No')
      break
else:
  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 = pos[i][1]+pos[i][2]
    if diff % 2 == 0:
      if 0 > num or num > diff:
        print("No")
        sys.exit()
    else:
      if 1 > num or num > diff:
        print("No")
        sys.exit()
print("Yes")
import numpy as np
n=int(input())
x=[list(map(int, input().split())) for _ in range(n)]

now=0
nplace=[0,0]
noflag=False
for y in x:
    dis=sum(map(abs, (np.array(y[1:]) - np.array(nplace))))
    # print(dis)
    if not (dis<=(y[0]-now) & (y[0]-now-dis)%2==0):
        noflag=True
    now=y[0]
    nplace=y[1:]
print('Yes') if noflag==False else print('No')
import fileinput

def main():
	pos = [0, 0]
	lines = [line.rstrip() for line in fileinput.input()]
	for line in lines[1:]:
		t, x, y = map(lambda x: int(x), line.split())
		dest = x + y
		src = sum(pos)
		if (abs(dest - src) > t):
			return print("No")
		else:
			arrivable = True if not abs(dest - src - t) % 2 else False
			if (arrivable):
				pos[0], pos[1] = x, y
				next
			else:
				return print("No")
              
	print("Yes")
                
main()
n = int(input())
t, x, y = [0] * n, [0] * n, [0] * n
tbl = [False] * n
for i in range(n):
    t[i], x[i], y[i] = map(int, input().split())
else:
    Z = list(zip(t, x, y))
    for d, i in enumerate(Z):
        if i[0] >= i[1] + i[2] and i[0] % (i[1] + i[2]) == 0:
            tbl[d] = True
print("Yes") if set(tbl) & {True} else print("No")
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 21 23:53:42 2020

@author: liang
"""

N = int(input())

prev = (0, 0, 0)

flag = True

for i in range(N):
    t, x, y = map(int, input().split())
    if t%2 != (x+y)%2:
        flag = False
    if x+y - prev[1] - prev[2] > t-prev[0]:
        flag = False
    prev = (t,x,y)

if flag:
    print("Yes")
else:
    print("No")
N=int(input())
t=0
x=0
y=0
for i in range(N):
    t_next,x_next,y_next=map(int,input().split())
    zikan=t_next - t
    kyori=abs(x_next-x)+abs(y_next-y)
    if kyori>zikan or (zikan-kyori)%2==1:
        print('NO')
        exit(0)
print('YES')
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 (((costtime - (diffx + diffy)) % 2) == 1 ) ):
    print("NO")
    exit()
  nowtime = nexttime
  nowx = nextx
  nowy = nexty



print("YES")
N = int(input())
A = [[0, 0, 0]]
for i in range(N):
    A.append([int(x) for x in input().split()])

for i in range(N):
    crr = A[i]
    nxt = A[i + 1]

    diff_t = nxt[0] - crr[0]
    diff_x = nxt[1] - crr[1]
    diff_y = nxt[2] - crr[2]

    if diff_t < diff_x + diff_y:
        print("No")
        exit(0)

print("Yes")
import fileinput

def main():
	pos = [0, 0]
	lines = [line.rstrip() for line in fileinput.input()]
	print(lines)
	for line in lines[1:]:
		t, x, y = map(lambda x: int(x), line.split())
		dest = x + y
		src = sum(pos)
		if (dest - src > t):
			return print("No")
		else:
			arrivable = True if not abs(dest - src - t) % 2 else False
			if (arrivable):
				pos[0], pos[1] = x, y
				next
			else:
				return print("No")
              
	print("Yes")
                
main()
N = int(input())
start = [0, 0]
start_t = 0
for i in range(N):
    t, x, y = map(int, input().split())
    now = [x, y]
    dt = t - start_t
    dist = abs(now[0]-start[0]) + abs(now[1]-start[1])
    if dist > dt:
        print('No')
        quit()
    if dt % 2 == 0 and dist % 2 != 0:
        print('No')
        quit()
    if dt % 2 != 0 and dist % 2 == 0:
        print('No')
        quit()

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

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

to, xo, yo = 0, 0, 0

for i in range(N):
  t, x, y = map(int, input().split())
  DeltaT = abs(t - to)
  DeltaX = abs(x - xo)
  DeltaY = abs(y - yo)
  if DeltaT >= DeltaX + DeltaY:
    if (DeltaT % 2 == 1 and (DeltaX + DeltaY) % 2 == 1) or (DeltaT % 2 == 0 and (DeltaX + DeltaY) % 2 == 0):
      to, xo, yo = t, x, y
  else:
    print('No')
    break
    
else:
  print('Yes')
n = int(input())
prev_t = 0
prev_x = 0
prev_y = 0
ans = True
for i in range(n):
    t,x,y = map(int,input().split())
    d_t = t - prev_t
    d_x = x - prev_x
    d_y = y - prev_y
    distance = d_x + d_y
    if d_t < distance or (d_t % 2) != (distance % 2):
        ans = False


if ans:
    print("Yes")
else:
    print("No")
# -*- coding: utf-8 -*-
import math

lastT, lastX, lastY = 0, 0, 0
flag = True

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

    # print( math.fabs(t - lastT) + math.fabs(t - lastT) )

    if ( t - lastT < math.fabs(x - lastX) + math.fabs(y - lastY)
        or ( (t - lastT) - math.fabs(x - lastX) - math.fabs(y - lastY) ) % 2 == 1 ):
        flag = False

    lastT = t
    lastX = x
    lastY = y

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

N=int(input())
S = numpy.zeros(N*3,dtype=int).reshape(N,3)
for i in range(N):
	S[i,:]= list(map(int,input().split())) 

i=0
while i <N:
	L=S[i,0] - abs(S[i,1]) - abs(S[i,2])
	if L<0:
		break
	elif L%2==0:
		i+=1
	else:
		break

if i ==N:
	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")
    exit()
  elif (time-dis)%2 == 0:
    loc = [a[1],a[2]]
    
  else :
    print("No")
    exit()
  
else :
  print("Yes")
from sys import exit

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

l.insert(0, [0, 0, 0])
for i in range(n):
    t1, x1, y1 = l[i]
    t2, x2, y2 = l[i+1]
    if abs(x2 - x1) + abs(y2 - y1) > t2 - t1 or abs(x2 - x1) + abs(y2 - y1) + (t2 - t1) % 2 == 1:
        print('No')
        exit()

print('Yes')
n = int(input())
txy = [list(map(int, input().split())) for i in range(n)]

now = [0, 0]
for p in txy:
    d = abs(p[1] - now[0] + p[2] - now[1])
    if p[0] % 2 == d % 2:
        continue
    else:
        print("No")
        exit()

print("Yes")
N = int(input())
t=[0]*(N+1); x=[0]*(N+1); y=[0]*(N+1)
t_diff=0; x_diff=0; y_diff=0

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

print(t, x, y)

for i in range(N):
    t_diff += t[i+1]-t[i]
    x_diff += x[i+1]-x[i]
    y_diff += y[i+1]-y[i]
    if t_diff%2 != (x_diff+y_diff)%2 or t[-1] < (x[-1]+y[-1]):
        print("No")
        exit()

print("Yes")