peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())
x = [list(map(int, input().split())) for i in range(N)]
dx = [1, -1, 0, 0]
dy = [0, 0, 1, -1]
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
if flag == 0:
    print("Yes")
else:
    print("No")
N = int(input())
t = [0]*N
x = [0]*N
y = [0]*N

cx, cy, ct = 0, 0, 0
for i in range(N):
  t[i], x[i], y[i] = map(int, input().split())
  dx, dy, dt = abs(x[i]-cx), abs(y[i]-cy), abs(t[i]-ct)
  if dt < dx+dy:
    print("No")
    exit()
  if (dt-dx-dy) % 2 == 1:
    print("No")

print("Yes")
n = int(input())
plcs = [list(map(int,input().split())) for _ in range(n)]
A = [0, 0, 0]
for i in range(n):
    A = [plcs[i][j] - A[j] for j in range(3)]
    if A[0] >= A[1] + A[2] and A[0] % 2 == abs(A[1] + A[2]) % 2:
        continue
    else:
        print('No')
        exit()
print('Yes')
#13 C - Traveling
N = int(input())

plan = []
for _ in range(N):
    ti,xi,yi = map(int,input().split())
    plan.append((ti,xi,yi))

spot = (0,0,0)
result = 'Yes'
for t,x,y in plan:
    if ((t-spot[0])%2 == (abs(x-spot[1])+abs(y-spot[2]))%2) and ((x-spot[1])<=(t-spot[0])) and ((y-spot[2])<=(t-spot[0])):
        spot = (t,x,y)
    else:
        result = 'No'
        break
print(result)
n = int(input())
t=[0]*(n+1)
x=[0]*(n+1)
y=[0]*(n+1)
for i in range(1,n+1):
    t[i],x[i],y[i]=map(int, input().split())
    
for i in range(1,n+1):
    time=t[i]-t[i-1]
    trip=x[i]-x[i-1]+y[i]-y[i-1]
    if time<trip:
        print("No")
        exit()
    else:
        extra=time-trip
        if extra%2!=0:
            print("No")
            exit()

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

for i in range(n-1):
    dt=m[i+1][0]-m[i][0]
    dx=abs(m[i+1][1]-m[i][1])
    dy=abs(m[i+1][2]-m[i][2])

    if dt<dx+dy:
        print("No")
        exit()
    else:
        if dt%2!=(dx+dy)%2:
            print("No")
            exit()

print("Yes")
n = int(input())
tb,xb,yb = 0,0,0
for _ in range(n):
    ta,xa,ya = list(map(int, input().split()))
    tdiff = abs(ta-tb)
    mdiff = abs(xa-xb) + abs(ya-yb)
    if tdiff < mdiff or (tdiff + mdiff) & 1:
        print('No')
        exit()

print('Yes')
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
if No == 0:
    print("Yes")
else:
    print("No")
import fileinput

def main():
	pos = [0, 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 = abs(x - pos[1]) + abs(y - pos[2])
		t_d = t - pos[0]
        
        
		if (dest <= t_d and (dest % 2 == t % 2)):
			pos[0], pos[1], pos[2] = t, x, y
			next
		else:
			return print("No")
	print("Yes")
                
main()
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")
n=int(input())
ans="Yes"
a,b,c=0,0,0
for i in range(n):
  t,x,y=map(int,input().split())
  if abs(b-x)+abs(y-c)>(t-a):
    ans="No"
    break
  elif (t-a-(abs(b-x)+abs(y-c)))%2!=0:
    ans="No"
    break
  else:
    a=t
    b=x
    y=c

print(ans)
N = int(input())
t=[0]*N; x=[0]*N; y=[0]*N
t_diff=0; x_diff=0; y_diff=0

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

for i in range(N-1):
    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 and t[-1] > (x[-1]+y[-1]):
    print("Yes")
else:
    print("No")
#奇数のとき、xとy足して奇数になる点にしか止まれない。偶数の時も同じ
#xとyの和がステップ数より多いとき、たどり着けない
N = int(input())
#最初にいる位置
T, X, Y = 0, 0, 0
for i in range(N):
  t, x, y = map(int, input().split())
  wa = (x-X) + (y-Y)
  time = t - T
  if time < wa:
    print('No')
    exit()
  if (time- wa)%2 == 1:
    print('No')
    exit()
  T, X, Y = t, x, y
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("Yes")
    exit()
print("No")
# coding: utf-8
import math
n = int(input())
t = 0
x = 0
y = 0
txy = []
for i in range(n):
    ti, xi, yi = list(map(int, input().split()))
    txy.append((ti, xi, yi))

for ti, xi, yi in txy:
    if abs(xi - x) + abs(yi - y) > abs(ti - t):
        print("NO")
        exit()
    elif (abs(xi - x) + abs(yi - y) - abs(ti - t)) % 2 != 0:
        print("NO")
        exit()
    else:
        t = ti
        x = xi
        y = yi
print("YES")
def dist(x,y):
    return abs(x[0]-y[0])+abs(x[1]-y[1])
N = int(input())
X = [list(map(int,input().split())) for _ in range(N)]
flag = 0
t1 = 0
x1,y1 = 0,0
for i in range(N):
    t2,x2,y2 = X[i]
    dt = t2-t1
    d = dist((x1,y1),(x2,y2))
    if dt>=d and (dt-d)%2==0:continue
    flag = 1
    break
    t2,x2,y2 = t1,x1,y1
if flag==0:
    print("Yes")
else:
    print("No")
N = int(input())
# 初期状態
T = [0]
X = [0]
Y = [0]
for i in range(N):
    t, x, y = map(int, input().split())
    T.append(t)
    X.append(x)
    Y.append(y)

# パリティに着目せよ
count = 0
for i in range(N):
    distanceSum = abs(X[i+1]-X[i]) + abs(Y[i+1]-Y[i])
    T_parity = (T[i+1]-T[i]) % 2
    Distance_parity = distanceSum % 2
    if (T_parity - Distance_parity) % 2 == 0:
        count += 1

if count == N:
    print('Yes')
else:
    print('No')
import sys
n=int(input())
px=0
py=0
pt=0
for i in range(n):
    t,x,y=map(int,input().split())
    if abs(x-px)+abs(y-py)>t-pt or abs(x-px)+abs(y-py)%2!=(t-pt)%2:
        print('No')
        sys.exit()
    else:
        px=x
        py=y
        pt=t
print('Yes')
N = int(input())
ans = "Yes"
X = 0
Y = 0
T = 0
for _ in range(N):
    t,x,y = map(int, input().split())
    dt = t-T
    d = abs(X-x)+abs(Y-y)-dt
    if d > 0 or d%2 == 1:
        ans = "No"
    T += t
    X = x
    Y = y

print(ans)
import sys

N = int(input())
old_t = 0
old_x = 0
old_y = 0
for i in sys.stdin:
    a = list(map(int, i.split(' ')))
    t = a[0]
    x = a[1]
    y = a[2]
    d = abs(x - old_x) + abs(y-old_y)
    T = t - old_t
    if (T % 2 != d % 2):
        print('No')
        sys.exit(0)
    if (T <= d):
        print('No')
        sys.exit(0)
    old_t = t
    old_x = x
    old_y = y
print('Yes')
n = int(input())

data = [input() for _ in range(n)]

for d in data:
  t, x, y = [int(i) for i in d.split()]
  
  s = t - x
  
  if s < 0 or s < y:
    print('No')
    exit()
  elif s == y:
    break
  else:
    for c in range(1, s+1):
      if y == 2*c -s:
        break
    else:
      print('No')
      exit()
print('Yes')
n = int(input())
t = 0
x = 0
y = 0
list1 = []

for i in range(n):
  t_i, x_i, y_i = map(int, input().split())
  list1.append((t, x, y))
  
for t_i, x_i, y_i in list1:
  distance = (x_i - x) + (y_i - y)
  if distance > (t_i - t) or (t_i - t)%2 == 1:
    print('No')
    break

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

data = [input() for _ in range(n)]

for d in data:
  t, x, y = [int(i) for i in d.split()]
  
  s = t - x
  
  if s < 0:
    print('No')
    exit()
  elif s == y:
    break
  else:
#    flag = False
    for c in range(1, s+1):
      
      if y == 2*c -s:
        break
    else:
      print('No')
      exit()
print('Yes')
N = int(input())
Flag = True
for _ in range(N):
    t,x,y = map(int,input().split())
    if t < x + y :
        Flag = False
        break
    elif t % 2 == 1 and (x+y)%2 == 0:
        Flag = False
        break
    elif t % 2 == 0 and (x+y)%2 == 1:
        Flag = Flag
        break
print('Yes' if Flag else 'No')
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())
location = [list(map(int, input().split())) for j in range(n)]
counter = 0
adj_t, adj_x, adj_y = 0,0,0

for i in range(n):
    time = location[i][0] - adj_t
    x = location[i][1] - adj_x
    y = location[i][2] - adj_y
    if abs(x)<= time and abs(y) <=time and abs(x + y) in range(time, 0, -2):
        counter += 1
    adj_t = time
    adj_x = x
    adj_y = y
    
if counter == len(location):
    print('Yes')
else:
    print('No')
N = int(input())
tmp = [tuple(map(int,input().split())) for i in range(N)]

ct = 0
cx = 0
cy = 0
for t,x,y in tmp:
    dst = abs(cx - x) + abs(cy - y)
    if dst > t-ct or dst%2 != (t-ct)%2:
        print('NO')
        exit()
    ct,cx,cy = t,x,y

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

flag = 1
for i in range(N):
    if(t%2==(x+y)%2 and x+y<t):
        continue
    else:
        flag = 0
        break

if(flag):
    print("Yes")
else:
    print("No")
N=int(input())
TXY=[list(map(int,input().split(' '))) for i in range(N)]
t,x,y=0,0,0
for i,j,k in TXY:
    if i-t!=abs(x-j)+abs(y+k):
        print('No')
        exit()
print('Yes')
N = int(input())
Flag = True
x_bef = 0
y_bef = 0
t_bef = 0
for _ in range(N):
    t_now,x_now,y_now = map(int,input().split())
    t = t_now - t_bef
    x = abs(x_now - x_bef)
    y = abs(y_now - y_bef)
    if t < x + y :
        Flag = False
        break
    elif t % 2 == 1 and (x+y)%2 == 0:
        Flag = False
        break
    elif t % 2 == 0 and (x+y)%2 == 1:
        Flag = Flag
        break
print('Yes' if Flag else '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)%2 != (t-prev_t)%2:
        print('No')
        exit()
    prev_t = t
print('Yes')
n = int(input())
target_point = [list( map(int,input().split())) for i in range(n)]
current_point = [0, 0, 0]
for i in range(n):
    dist = abs(target_point[i][1] - current_point[1]) + abs(target_point[i][2]) - current_point[2]
    time = target_point[i][0] - current_point[0]
    if time >= dist and (time - dist) % 2 == 0:
        current_point = target_point[i]
    else:
        print('No')
        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) & (dis-now-y[0])%2==0):
        noflag=True
    now=y[0]
    nplace=y[1:]
print('Yes') if noflag==False else print('No')
n = int(input())
info = [list(map(int, input().split())) for i in range(n)]
info = sorted(info)

t = 0
x = 0
y = 0
for t1, x1, y1 in info:
    diff = abs(x - x1) + abs(y - y1)
    diff_t = abs(t - t1)
    if diff_t >= diff and diff % 2 == diff % 2:
        continue
    else:
        print("No")
        exit()
print("Yes")
prev,pt = (0,0),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 not((t - pt) == f((x,y), prev)):
		b = False
		break 
	prev,pt = (x,y),t

print 'Yes' if b else 'No'
rows = int(input())
x = []
for i in range(rows):
    x.append(list(map(int, input().split())))

for j in range(rows):
    if x[j][0] >= abs(x[j][1]) + abs(x[j][2]):
        if x[j][0] % 2 == (abs(x[j][1]) + abs(x[j][2])) % 2:
            pass
        else:
            print("No")
            exit()
    else:
        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 (t-(x+y))%2 != 0:
          print('No')
          exit()
print('Yes')
N = int(input())
x = 0
y = 0
t = 0
for _ in range(N):
    ti, xi, yi = map(int, input().split())
    if abs(x-xi) + abs(y-yi) > ti - t or (x == xi and y == yi):
        print('No')
        exit()
    x = xi
    y = yi
    t = ti

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

time = 0
now = [0, 0]
for i in range(n):
    t, x, y = map(int, input().split())
    d = abs(x - now[0]) + abs(y - now[1])
    if d <= t - time and d % 2 == (t - time) % 2:
        continue
    else:
        print("No")
        exit()
else:
    print("Yes")
ii = input()
ii = int(ii)
la = []
for jj in range(ii):
    la.append(input())

flag = 1
for ss in la:
    t, x, y = ss.split(" ")
    t = int(t)
    x = int(x)
    y = int(y)
    
    if t < (x + y):
        print("No")
        flag = 0
        break
    elif (x + y - t)%2:
        print("No")
        flag = 0
        break

if flag:
    print("Yes")
def boolean(a,b):
    if((abs(a[0] - b[0]) -abs(a[1] - b[1]) - abs(a[2] - b[2])) %2 == 0):
        return 0
    else:
        return 1

N = int(input())
txy=[0 for i in range(N+1)]
txy[0]=[0,0,0]
for i in range(N):
    a=list(map(int,input().split()))
    txy[i+1]=a
ans = "Yes"
for i in range(1,N + 1):
    if(boolean(txy[i-1],txy[i])):
        ans = "No"
        break
print(ans)
N = int(input())
List = [list(map(int, input().split())) for _ in range(N)]
Sorted = sorted(List)
Sorted.insert(0, [0, 0, 0])

for i in range(N):
  if abs(Sorted[i+1][1] - Sorted[i][1]) + abs(Sorted[i+1][2] - Sorted[i][2]) > Sorted[i+1][0] - Sorted[i][0]:
    print("No")
    break
else:
  print("Yes")
def dist(s1,s2):
  return abs(s1[1]-s2[1]) + abs(s1[2]-s2[2])

N=int(input())
now = (0,0,0)
for i in range(N):
  next_ = list(map(int,input().split()))
  if dist(now,next_)<=next_[0]-now[0] and dist(now,next_) % 2 == (next_[0]-now[0])%2:
    continue
  else:
    print('No')
    exit()
print('Yes')
n = int(input())
for i in range(n):
  t,x,y = map(int,input().split())
  if (x+y) > t and (x+y)%2==t%2:
    print("No")
    exit()
print("Yes")
n = int(input())
d = [list(map(int, input().split())) for i in range(n)]

t, x, y = 0, 0, 0

flag = True
for ti, xi, yi in d:
  if ti > x + y:
    if (ti - t) % 2 != (abs(xi - x) + abs(yi - y)) % 2:
    	flag = False
    	break
    t = ti
    x = xi
    y = yi
    
  else:
    flag = False
    break
    
print("Yes" if flag else "No")
A = [[0,0]]
N = int(input())
for _ in range(N):
    t,x,y = map(int,input().split())
    A.append([t,x+y])
for i in range(1,N+1):
    if A[i][0]-A[i-1][0] >= A[i][1]-A[i-1][1] and (A[i][0]-A[i-1][0])%2 == (A[i][1]-A[i-1][1])%2:
        continue
    else:
        print('No')
        exit()
print('Yes')
N = int(input())
A = [[int(x) for x in input().split()]for i in range(N)]
T = 0            ####現在時刻
place = (0,0)    ####現在地
for i in range(N):
  if ((A[i][0]-T) + abs(A[i][1]-place[0]) + abs(A[i][2]-place[1]))%2 == 0:
    T = A[i][0]
    place = (A[i][1], A[i][2])
  elif ((A[i][0]-T) + abs(A[i][1]-place[0]) + abs(A[i][2]-place[1]))%2 == 1:
    print("No")
    exit()
print("Yes")
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-1][0] - posdata[i][0]) and l_parity != t_parity:
        print("No")
        exit()
        
print("Yes")
n = int(input())
tl = []
dl = []
flag = 0

for i in range(n):
    t, x, y = (int(x) for x in input().split())
    tl.append(t)
    dl.append((x, y))

for num in range(n):
    if tl[num] >= sum(dl[num]) and tl[num]%2 == sum(dl[num])%2:
        pass
    else:
        flag = 1

if flag == 0:
    print("Yes")
else:
    print("No")
# ABC086 C Traveling

n = int(input())
t, x, y = 0, 0, 0
flag = True

for i in range(n):
    _t,_x,_y = map(int, input().split())
    _d = abs(x - _x) + abs(y - _y)
    _dt = abs(t - _t)
    if _d > _dt or ((_d - _dt)%2) == 1:
        flag = False
    t,x,y = _t,_x,_y

if flag:
    print("YES")
else:
    print("NO")
T, X, Y = 0, 0, 0
cnt = 0
for n in range(int(input())):
  t, x, y = 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])
n = int(input())
txy = [list(map(int,input().split()))for _ in range(n)]
ok = True
time = 0
nx = 0
ny = 0
for i in range(n):
    t = txy[i][0]
    x = txy[i][1]
    y = txy[i][2]
    dist = abs(x-nx)+abs(y-ny)
    if not(t - time >= dist and (t- time )%2 == dist%2):
        ok = False
        break
    time+=t
    nx = x
    ny = y
if ok:print('Yes')
else:print('No')
N = int(input())
P = [[0,0,0]]
for i in range(N):
    t,x,y = map(int,input().split())
    P.append([t,x,y])
judge = False
for i in range(1,N+1):
    dt = P[i][0] - P[i-1][0]
    dist = abs(P[i][1] - P[i-1][1]) + abs(P[i][2] - P[i-1][2])
    if (dt % 2 == 0 and dist % 2 == 0 and dist <= dt) or (dt % 2 == 1 and dist % 2 == 1 and dist <= dt):
        judge = True
if judge:
    print("Yes")
else:
    print("No")
N = int(input())
T = [[0,0,0]]+[map(int, input().split()) for _ in range(N)]
flag = 'Yes'
i = 0
while flag=='Yes' and i<len(T)-2:
    a = T[i] 
    b = T[i]
    i += 1        
print(flag)
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 or dist == 0:
        f = False
        break       
print('Yes' if f else 'No')
N = int(input())
# 初期状態
T = []
X = []
Y = []
for i in range(N):
    t, x, y = map(int, input().split())
    T.append(t)
    X.append(x)
    Y.append(y)

# パリティに着目せよ
count=0
for i in range(N):
    if x + y <= t and t % 2 == (x+y)%2:
        count += 1

if count == N:
    print('Yes')
else:
    print('No')
N = int(input())
T = [[0,0,0]]+[map(int, input().split()) for _ in range(N)]
flag = 'Yes'
i = 0
while flag=='Yes' and i<len(T)-1:
#     t1,x1,y1 = T[i] 
#     t2,x2,y2 = T[i+1]
#     dis = abs(x2-x1)+abs(y2-y1)
#     _t = t2-t1
#     if dis > _t or _t%2 != dis%2:
#         flag = 'No'
    i += 1        
print(flag)
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) % 2:
        print("No")
        exit()

    x, y, t = dx, dy, dt
print("Yes")
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())
  
  lim_t=t[i+1]-t[i]
  lim_x=x[i+1]-x[i]
  lim_y=y[i+1]-y[i]
  
  if lim_x+lim_y>lim_t or (lim_t-lim_x-lim_y)%2==1:
    print('No')
    exit()
    
print('Yes')
N = int(input())
pos = [0, 0, 0]
ans = 'Yes'
for i in range(N):
  t, x, y = map(int, input().split())
  if t-pos[0] >= abs(x-pos[1]) + abs(y-pos[2]):
    if ((t-pos[0]) % 2 == 0) and ((abs(x-pos[1]) + abs(y-pos[2])) % 2 == 0):
      pass
    elif ((t-pos[0]) % 2 == 1) and ((abs(x-pos[1]) + abs(y-pos[2])) % 2 == 1):
      pass
    else:
      ans = 'No'
      break
  else:
    ans = 'No'
    break
print(ans)
# coding: utf-8

import sys

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

for i in range(N - 1):
	d = abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i])
	dt = t[i + 1] - t[i]
	if dt < d or (dt - d) % 2 == 1:
		print("No")
		sys.exit()
	
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) <= abs(ti) and abs(xi)+abs(yi) <= abs(ti) and abs(abs(xi)-abs(yi)) < abs(ti) and ti%2 == (xi+yi)%2):
        print('No')
        exit()
print('Yes')
# ABC86 C - Traveling
N = int(input())
ans = "Yes"
t, x, y = 0, 0, 0
for i in range(N):
    ti, xi, yi = map(int, input().split())
    dt, dx, dy = ti - t, abs(xi - x), abs(yi - y)
    if (dx + dy - dt) % 2 == 0:
        t, x, y = ti, xi, yi
    else:
        ans = "No"
        break
print(ans)
N = int(input())

plan = []
for i in range(N):
    plan += [[int(n) for n in input().split(' ')]]

ret = "YES"
t0 , x0, y0 = 0, 0, 0
for t, x, y in  plan:
    dt = t-t0
    dx = x-x0
    dy = y-y0

    result = dt - (dx+dy)
    if (result<0) | (result%2!=0):
        ret = "NO"
        break

    t0, x0, y0 = t, x, y

print(ret)
def boolean(a,b):
    if(abs(a[0] - b[0]) == abs(a[1] - b[1]) + abs(a[2] - b[2])):
        return 0
    else:
        return 1

N = int(input())
txy=[0 for i in range(N+1)]
txy[0]=[0,0,0]
for i in range(N):
    a=list(map(int,input().split()))
    txy[i+1]=a
ans = "Yes"
for i in range(1,N + 1):
    if(boolean(txy[i-1],txy[i])):
        ans = "No"
        break
print(ans)
n = int(input())
d = [list(map(int, input().split())) for i in range(n)]

t, x, y = 0, 0, 0

flag = True
for ti, xi, yi in d:
  if ti >= x + y:
    if (ti - t) % 2 != (abs(xi - x) + abs(yi - y)) % 2:
    	flag = False
    	break
    t = ti
    x = xi
    y = yi
    
  else:
    flag = False
    break
    
print("Yes" if flag else "No")
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 ( (nexttime < nextx+nexty) or ((((nextx + nexty) ) % 2) == (nexttime % 2) ) ):
    print("NO")
    exit()
  nowtime = nexttime
  nowx = nextx
  nowy = nexty



print("YES")
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 n == 0:
        if t[n] < abs(x[n] - 0) + abs(y[n] - 0) or (x[n] + y[n]) % 2 != t[n] % 2:
            print('No')
            exit()
    if t[n] < abs(x[n] - x[n - 1]) + abs(y[n] - y[n - 1]) or (x[n] + y[n]) % 2 != t[n] % 2:
        print('No')
        exit()

print('Yes')
n = int(input())
location = [list(map(int, input().split())) for j in range(n)]
counter = 0
adj_t, adj_x, adj_y = 0,0,0

for i in range(n):
    time = location[i][0] - adj_t
    x = location[i][1] - adj_x
    y = location[i][2] - adj_y
    dst = abs(x) + abs(y)
    if dst <=time and abs(x + y) in range(time, 0, -2):
        counter += 1
    adj_t = time
    adj_x = x
    adj_y = y
    
if counter == len(location):
    print('Yes')
else:
    print('No')
#-*- coding: utf-8 -*-
N=int(input())
import numpy as np
t=np.arange(N)
x=np.arange(N)
y=np.arange(N)
for n in range(N):
    t[n], x[n], y[n] = map(int, input().split())

kekka=[]
for i in range(N):
    kekka.append(t[i]>=x[i]+y[i] and t[i]%2==(x[i]+y[i])%2)
if all(kekka):
    print("Yes")
else:
    print("No")
n = int(input())
txy = [list(map(int, input().split())) for _ in range(n)]

X,Y = 0,0
ans = "Yes"
for t,x,y in txy:
    T = abs(x-X) + abs(y-Y)
    if T == t: continue
    else:
        t -= T
        if t > 0 and t%2==0: continue
        else: ans = "No"
print(ans)
n = int(input())

for _ in range(n):
  t, x, y = map(int, input().split())
  if x + y > t:
    status = "No"
    break
  elif (x+y)%2 != t%2:
    status = "No"
    break
  else:
    status = "Yes"
    
print(status)
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())

t = [0]
x = [0]
y = [0]

for _ in range(N):
    a, b, c = list(map(int, input().split()))
    t.append(a)
    x.append(b)
    y.append(c)

# print(f"t:{t}\nx:{x}\ny:{y}")

for index in range(1, N + 1):
    distance = (x[index] - x[index - 1]) + (y[index] - y[index - 1])
    if (t[index] - t[index - 1]) % 2 != distance % 2:
        print("No")
        break
else:
    print("Yes")
def dist(x,y):
    return abs(x[0]-y[0])+abs(x[1]-y[1])
N = int(input())
X = [list(map(int,input().split())) for _ in range(N)]
flag = 0
for i in range(1,N):
    dx = dist(X[i][1:],X[i-1][1:])
    dt = X[i][0]-X[i-1][0]
    if dt>=dx and (dt-dx)%2==0:
        continue
    else:
        flag = 1
        break
if flag==0:
    print("Yes")
else:
    print("No")