peterverebics/CodeNet_Python_118 huggingface dataset:
N=int(input())
a=[list(map(int,input().split())) for _ in range(N)]
dp=[[0,0] for _ in range(N+1)]
f=True
for i in range(N):
  t=a[i][0]-dp[i][1]
  x=a[i][1]
  y=a[i][2]
  if t>=x+y-dp[i][0] and t%2==(x+y+dp[i][1])%2:
    dp[i+1][0]=x+y
    dp[i+1][1]=a[i][0]
  else:
    f=False
    break
if f:print("Yes")
else:print("No")
n = int(input())
ans = "Yes"
now_x = 0
now_y = 0
now_t = 0

for i in range(n):
  t,x,y = map(int,input().split())
  
  if abs(now_x-x)+abs(now_y-y) > (t-now_t):
    ans = "No"
    break
    
  if (abs(now_x-x)+abs(now_y-y)-(t-now_t))%2 == 1:
    ans = "No"
    break
    
  now_x = x
  now_y = y
  now_t = t
    
print(ans)
n = int(input())
a,b,c=0,0,0
for i in range(n):
    t,x,y = map(int, input().split())
    sa = t-a
    if sa<abs(x-b)+abs(y-c):
        print("No")
        exit()
    else:
        tw = sa-abs(x-b)-abs(y-c)
        if tw%2!=0:
            print("No")
            exit()
    a,b,c=t,x,y
print("Yes")
N = int(input())
t = 0
x = 0
y = 0
for i in range(N):
    t1,x1,y1 = map(int,input().split())
    if abs(x1-x) + abs(y1-y) > t1-t or (abs(x1-x) + abs(y1-y) - (t1-t)) % 2 != 0:
        print('No')
        exit(0)
    t,x,y = t1,x1,y1
print('Yes')
N = int (input ())
t2 = 0
x2 = 0
y2 = 0
ans = 'Yes'
for i in range (N):
    t,x,y = map(int, input().split())
    if abs(x+y-x2-y2) <= t-t2:
        if ((abs(x2+y2-x-y))-(t-t2)) % 2 == 1:
            ans = 'No'
            break
    else:
        ans = 'No'
        break
    t2 = t
    x2 = x
    y2 = y
print (ans)
N = int(input())
s = 0
k = 0
l = 0
count = 0
for i in range(N):
  t, x, y = map(int, input().split())
  if t-s >= abs(x - k) + abs(y - l) and (t - s - (abs(x - k) + abs(y - l))) % 2 == 0:
    s = t
    k = x
    l = y
  else:
    count += 1
if count > 0:
  print('No')
else:
  print('Yes')
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")
        exit()
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)<=abs(t-T) and t%2==(x+y)%2:count+=1
    T,X,Y=t,x,y
print('Yes' if count==N else 'No')
N = int(input())
P = []
for _ in range(N):
    t,x,y = map(int, input().split())
    P.append((t,x,y))

ans = True
pre = (0,0,0)
for t,x,y in P:
    dt, dx, dy = t-pre[0], abs(x-pre[1]), abs(y-pre[2])
    if dt < dx+dy or (dt-(dx+dy))&1:
        ans = False
        break
    pre = (t,x,y)

print('Yes' if ans else 'No')
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 == 1:
        print("No")
        sys.exit()
        
print("Yes")
n = int(input())
pt,px,py = 0, 0, 0

for _ in range(n):
  ct,cx,cy = map(int,input().split())
  t = ct - pt
  d = abs(cx-px) + abs(cy-py)
  if t < d or (t%2) != (d%2):
    print('No')
    break
  pt,px,py = ct,cx,cy
else:
  print('Yes')
n = int(input())
ti_1, xi_1, yi_1 = [0,0,0]
for i in range(n):
  ti, xi, yi = map(int, input().split())
  tlim = ti- ti_1
  dist = abs(xi - xi_1) + abs(yi - yi_1)
  if tlim < dist or (tlim-dist) % 2 == 1:
    print('No')
    exit()
  else:
    ti_1, xi_1, yi_1 = ti, xi, yi
    continue
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 = abs(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())
yes = True
for _ in range(N):
  t, x, y = map(int, input().split())
  margin = t - (x + y)
  if not(margin >= 0 and margin % 2 == 0):
    yes = False
if yes:
  print("Yes")
else:
  print("No")
# -*- 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())

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

flag = True
for i in range(1,n+1):
    dist = abs(x[i] - x[i-1]) + abs(y[i] - y[i-1])
    if t[i] - t[i-1] < dist or (t[i] - t[i-1])%2 != dist%2:
        flag = False

if flag == True:
    print('Yes')
else:
    print('No')
def main():
    N = int(input())
    t,x,y = 0,0,0
    ans = 'Yes'
    for i in range(N):
        ti,xi,yi = (int(x) for x in input().split())
        dt = ti - t
        dist = abs(xi-x) + abs(yi-y)
        if dt < dist or dist%2 != dt%2:
            ans = 'No'
            break
        else:
            t,x,y = ti,xi,yi
    print(ans)

if __name__ == '__main__':
    main()
N = int(input())
t = 0
x = 0
y = 0
for i in range(N):
  T,X,Y = map(int,input().split())
  dt = T - t
  dist = abs(X-x) + abs(Y - y)
  if dist > dt:
    print("No")
    break
  if dist%2 != dt%2:
    print("No")
    break
  t = T
  x = X
  y = Y
  if i == N - 1:
    print("Yes")
n = int(input())
st = 0
sx, sy = 0, 0
ng = False
for _ in range(n):
    t, x, y = map(int, input().split())
    dt = (t - st)
    dx = abs(sx - x)
    dy = abs(sy - y)

    if dt%2 == (dx+dy)%2 and dx+dy <= dt:
        st = t
        sx = x
        sy = y
    else:
        ng = True
        break
print('No' if ng else 'Yes')
n = int(input())

t0, x0, y0 = 0, 0, 0
cnt = 0

for _ in range(n):
    t, x, y = map(int, input().split())
    diff_t = t-t0
    distance = abs(x0-x)+abs(y0-y)
    if diff_t >= distance and (diff_t - distance == 0 or (diff_t - distance) % 2 == 0):
        cnt += 1
    t0, x0, y0 = t, x, y

print('Yes' if cnt == n else 'No')
import sys
N = int(input())
d = [list(map(int,input().split())) for l in range(N)]
d.insert(0,[0,0,0])
#print(N)
#print(d)

def get_length(l1,l2):
    return abs(l1[1] - l2[1]) + abs(l1[2] - l2[2])

for cnt in range(N):
    length = get_length(d[cnt],d[cnt+1])
    time = abs(d[cnt][0]-d[cnt+1][0])
    if length <= time and abs(time - length) % 2 == 0:
        pass
    else:
        print("No")
        sys.exit(0)

print("Yes")
n = int(input())
px = py = pt = 0
for i in range(n):
	t,x,y = map(int,input().split())
	d = abs(x - px) + abs(y - py)
	nt = t - pt
	if nt < d or d%2 != nt%2:
		print("No")
		exit()
	px = x
	py = y
	pt = t
print("Yes")
N = int(input())
pre_t = 0
pre_x = 0
pre_y = 0
for i in range(N):
    t,x,y = map(int, input().split())
    if (t%2)+(x+y)%2 == 1 or x+y > t or abs(pre_x-x)+abs(pre_y-y) > (t-pre_t):
        print("No")
        exit()
    pre_t = t
    pre_x = x
    pre_y = y
print("Yes")
N=int(input())
txy=[list(map(int,input().split()))for _ in range(N)]

ans='Yes'
now=[0,0,0]
for t,x,y in txy:
    distance=abs(x-now[1])+abs(y-now[2])
    if distance>t-now[0] or (distance+(t-now[0]))%2>0:
        ans='No'
        break
    else:
        now=[t,x,y]

print(ans)
N = int(input())
now = (0,0,0)
for i in range(N):
    t,x,y = map(int,input().split())
    diff_dist = abs(x-now[1]) + abs(y-now[2])
    diff_time = t - now[0]
    if diff_time % diff_dist == 0 and diff_time >= diff_dist:
        pass
    else:
        print("No")
        exit()
    now = (t,x,y)
print("Yes")
n = int(input())
start = [0, 0]
curtime = 0
flag = True
for i in range(n):
    t, x, y = map(int, input().split())
    dist = abs(x-start[0]) + abs(y-start[1])
    time = t-curtime
    if dist <= time and dist % 2 == time % 2:
        start = [x, y]
        curtime = t
        continue
    print('No')
    flag = False
    break
if flag:
    print('Yes')
n = int(input())
t = [list(map(int,input().split())) for _ in range(n)]
t.insert(0,[0,0,0])
for i in range(1,n+1):
    d_sec = t[i][0] - t[i-1][0]
    d_x = abs(t[i][1]- t[i-1][1])
    d_y = abs(t[i][2]- t[i-1][2])
    d_xy = d_x + d_y
    if (d_sec < d_xy) | (d_sec%2 != d_xy%2):
        print("No")
        break
else:
    print("Yes")
N = int(input())
travel = [list(map(int, input().split())) for _ in range(N)]

buff = [0, 0, 0]
ans = "Yes"

for i in range(N):
    t, x, y = travel[i]
    time = t - buff[0]
    distance = abs(x - buff[1]) + abs(y - buff[2])
    if time < distance or (time - distance) % 2 == 1:
        ans = "No"
        break
    buff = travel[i]

print(ans)
n = int(input())

ans = 1
tt, xx, yy = 0, 0, 0
for i in range(n):
    t, x, y = map(int, input().split())
    keep = abs(xx - x) + abs(yy - y) - (t - tt)
    if (keep > 0) | (keep % 2 != 0):
        ans *= 0
    tt, xx, yy = t, x, y
print(['No', 'Yes'][ans])
N = int(input())
TXY = []
flag = True
for i in range(N):
	txy = list(map(int,input().split()))
	if not (txy[0] % 2 == (txy[1] + txy[2]) % 2 and txy[0] >= (txy[1] + txy[2])):
		flag = False
if flag == True:
	print("Yes")
else:
	print("No")
N = int(input())
time = [0]*100009
x = [0]*100009
y = [0]*100009
for i in range(N):
    time[i+1],x[i+1],y[i+1] = [int(x) for x in input().split()]

flag = True
for i in range(N):
    dt = time[i+1]-time[i]
    dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])
    if dt < dist:
        flag = False
    if dt % 2 != dist % 2:
        flag = False
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)
    t,x,y=t_next,x_next,y_next
print('Yes')
n=int(input())
sx,sy=0,0
f=True
t1=0
for i in range(n):
    t2,gx,gy=map(int,input().split())
    a=abs(sx-gx)+abs(sy-gy)
    t=t2-t1
    if a>t:
        f=False
    elif (a-t)%2==1:
        f=False
    sx,sy=gx,gy
    t1=t2
if f:
    print("Yes")
else:
    print("No")
def solve():
    N = int(input())
    A = [[0,0,0]]
    for _ in range(N):
        a = list(map(int, input().split()))
        A.append(a)

    ans = 'Yes'

    for i in range(N):
        t1, x1, y1 = A[i]
        t2, x2, y2 = A[i+1]

        time = t2 - t1
        x = abs(x2 - x1)
        y = abs(y2 - y1)

        if time < x+y or (time+x+y) % 2 != 0:
            ans = 'No'

    return ans

print(solve())
N = int(input())
t = 0
x = 0
y = 0
for ti, xi, yi in [map(int, input().split(' ')) for n in range(N)]:
    if not (abs(xi-x)+abs(yi-y) <= ti-t and ti%2 == (xi+yi)%2):
        print('No')
        exit()
    else:
        t = ti
        x = xi
        y = yi
print('Yes')
t, x, y = 0, 0, 0
for i in range(int(input())):
    next_t, next_x, next_y = map(int, input().split())
    diff = abs(x - next_x) + abs(y - next_y)
    if diff > (next_t - t) or (diff - (next_t - t)) % 2 == 1:
        print("No")
        exit(0)
    t, x, y, = next_t, next_x, next_y
print("Yes")
N = int(input())
T, X, Y = 0, 0, 0
cnt = 0
for _ in range(N):
  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())
ans = True
k,x,y = 0,0,0
for i in range(N):
    t,p,q = map(int,input().split())
    d = abs(x-p)+abs(y-q)
    if d>(t-k):ans = False
    if ((t-k)-d)%2==1:ans = False
    k,x,y = t,p,q
print("Yes" if ans else "No")
n=int(input())

bt=0
bx=0
by=0
ans='Yes'
for i in range(n):
  t,x,y=map(int,input().split())
  dt=t-bt
  dx=abs(x-bx)
  dy=abs(y-by)

  if (dx+dy)>dt:
    ans='No'
  elif (dt-(dx+dy))%2==1:
    ans='No'

  bt=t
  bx=x
  by=y

print(ans)
for _ in range(int(input())):
  t, x, y = map(int, input().split())
  if (x + y + t) % 2 or (x + y) > t:
    print('No')
    exit(0)
print('Yes')
#!/usr/bin/env python3
import sys
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(n):
    length = abs((x[i+1]-x[i])+(y[i+1]-y[i]))
    move = t[i+1]-t[i]
    if move < length:
        print('No')
        sys.exit()
    if (move - length)%2==1:
        print('No')
        sys.exit()
print('Yes')
#python3

def main():
    n = int(input())
    for _ in range(n):
        t, x, y = map(int, input().split())
        if t < x + y:
            print('No')
            return
        if (x+y-t)%2 != 0:
            print('No')
            return
    print('Yes')
main()
n = int(input())
flg = True
x,y = 0,0
for i in range(n):
  a,b,c = map(int,input().split())
  if (a < abs(b) + abs(c) - (x+y)) or (a % 2 != (abs(b) + abs(c)) % 2):
    flg = False
    break
  else:
    x = b
    y = c
#print(flg)
print("Yes" if flg else "No")
N = int(input())
pt, px, py = [0, 0, 0]
ans = 'Yes'
for i in range(N):
    t, x, y = [int(n) for n in input().split()]
    dt = t-pt
    dxy = sum([abs(x-px), abs(y-py)])
    if dt < dxy or dt%2 != dxy%2:
        ans = 'No'
        break
    else:
        pt, px, py = t, x, y
print(ans)
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:
        start = now
        start_t = t
else:
    print('Yes')
N = int(input())
t = 0
xy = [0,0]
ans = 'Yes'
for i in range(N):
    ti,xi,yi = map(int,input().split())
    dt = ti - t
    dx = abs(xi - xy[0])
    dy = abs(yi - xy[1])
    if dt < dx+dy:
        ans = 'No'
    elif dt%2 != (dx+dy)%2:
        ans = 'No'
    t = ti
    xy = [xi,yi]
print(ans)
n = int(input())
t, x, y = 0, 0, 0
for _ in range(n):
    t2, x2, y2 = map(int, input().split())
    T = t2 - t
    d = abs(x2 - x) + abs(y2 - y)
    if T < d or (T % 2 != d % 2):
        print('No')
        break
    t, x, y = t2, x2, y2
else:
    print('Yes')
N = int(input())
plan = [[0,0,0]] + [list(map(int, input().split())) for i in range(N)]
f = True
for i in range(N):
    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())
cnt=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%2==(x+y)%2:cnt+=1
  T,X,Y=t,x,y
print("Yes" if cnt==N else "No")
def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(input())
    TXY = [[int(i) for i in input().split()] for j in range(N)]
    time, px, py = 0, 0, 0
    for t, x, y in TXY:
        move = abs(x-px) + abs(y-py)
        # print(move, t-time)
        if (t - time) % 2 != move % 2 or t - time < move:
            return print("No")
        time, px, py = t, x, y
    print("Yes")


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

P = [[0, 0, 0]]

ans = 'Yes'

for i in range(N):
    l = list(map(int, input().split()))
    P.append(l)

for i in range(N):
    c = P[i+1][0] - P[i][0]
    d = abs(P[i+1][1] - P[i][1]) + abs(P[i+1][2] - P[i][2])

    if c % d != 0:
        ans = 'No'
        break

print(ans)
n = int(input())
lst1 = [list(map(int,input().split())) for i in range(n)]

lst1.sort()

x,y = 0,0
t = lst1[0][0]
for i in range(n):
    if i > 0:
        t = lst1[i][0] - lst1[i-1][0]
    move = abs(lst1[i][1]-x) + abs(lst1[i][2]-y)
    if move > t:
        print("No")
        exit()
    elif move%2 != t%2:
        print("No")
        exit()

    x,y = lst1[i][1],lst1[i][2]

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

pT, pX, pY = 0, 0, 0

for i in range(N):
    cT, cX, cY = l[i]
    mvT, mvX, mvY = abs(cT-pT), abs(cX-pX), abs(cY-pY)
    
    dam = mvT - (mvX+mvY)

    if dam %2 == 1 or dam < 0:
        print('No')
        exit()

    pT, pX, pY = l[i]

print('Yes')
n = int(input())
ct, cx, cy = 0, 0, 0 
for i in range(n):
    t, x, y = map(int, input().split())
    if abs(ct-t) < abs(cx-x) + abs(cy-y) or (abs(ct-t) + abs(cx-x) + abs(cy - y)) % 2 != 0:
        print('No')
        break
    else:
        ct = t 
        cx = x
        cy = y
else:
    print('Yes')
N = int(input())
PX = PY = PT = 0

for _ in range(N):
  T,X,Y = map(int,input().split())
  if abs(X-PX)+abs(Y-PY)>T-PT or (X+Y-PX-PY)%2 != (T-PT)%2:
    print("No")
    exit()
  else:
    PX = X
    PY = Y
    PT = T
    
print("Yes")
N = int(input())
flag = 1
t1 = 0
x1 = 0
y1 = 0
for i in range(N):
  t2, x2, y2 = map(int, input().split())
  dt = t2-t1
  dx = abs(x2-x1)
  dy = abs(y2-y1)
  if dt<(dx+dy) or dt %2 != (dx+dy) % 2:
    flag = 0
    break
  t1 = t2
  x1 = x2
  y1 = y2
print("Yes" if flag else "No")
n=int(input())
inix=0
iniy=0
for _ in range(n):
    t,x,y=map(int,input().split())
    dist=abs(x-inix) + abs(y-iniy)
    if t<dist or (t+dist)%2 != 0:
        print('No')
        break
else:
    print('Yes')
t,x,y = 0, 0, 0
for i in range(int(input())):
    next_t,next_x,next_y = map(int, input().split())
    dist = abs(next_x - x) + abs(next_y - y)
    time = next_t - t
    if dist > time or (dist - time) % 2 == 1:
        print("No")
        exit(0)
    t,x,y = next_t,next_x,next_y
print("Yes")
n=int(input())
#a,b=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
t_bef=0
x_bef=0
y_bef=0
flag='Yes'

for i in range(1,n+1):
    t,x,y=map(int,input().split())
    dt=t-t_bef
    dist=abs(x-x_bef)+abs(y-y_bef)
    if (dt%2 != dist%2) or dist>dt:
        flag='No'
        break
    t_bef,x_bef,y_bef=t,x,y

print(flag)
# 距離的に到達可能か、経過時間と距離差の偶奇が一致してるか

N = int(input())
pt = 0
px = 0
py = 0
#ans = True
for _ in range(N):
    t,x,y = map(int,input().split())
    if abs(x-px) + abs(y-py) > t-pt:
        print('No')
        exit()
    if (abs(x-px) + abs(y-py))%2 != (t-pt)%2:
        print('No')
        exit()
    pt = t
    px = x
    py = y
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)

for i in range(N):
 c=abs((xl[i]+yl[i])-(xl[i-1]+yl[i-1]))
 d=abs(tl[i]-tl[i-1])
 cl.append(c)
 dl.append(d)

count=0
for i in range(N):
 if al[i]==bl[i] and (xl[i]+yl[i])<=tl[i] and cl[i]<=dl[i]:
  count+=1
if count==N:
  print("Yes")
else :
  print("No")
t=0
x=0
y=0
n=int(input())
for i in range(n):
    ti,xi,yi=map(int,input().split())
    t=ti-t
    x=xi-x
    y=yi-y
    if t%2!=(abs(x+y))%2:
        print('No')
        exit()
    elif t<abs(x)+abs(y):
        print('No')
        exit()
print('Yes')
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

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

nx, ny = 0, 0
time = 0

ans = "Yes"
for i in range(N):
    t, x, y = TXY[i]
    dt = t - time
    move = abs(nx - x) + abs(ny - y)
    if move > dt:
        ans = "No"
        break
    if dt % 2 != move % 2:
        ans = "No"
        break
    time, nx, ny = t, x, y

print(ans)
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,x1,y1 = 0,0,0
for i in range(N):
    t2,x2,y2 = X[i]
    d = dist((x1,y1),(x2,y2))
    dt = t2-t1
    if dt>=d and (dt-d)%2==0:
        t1,x1,y1 = X[i]
    else:
        flag=1
        break
if flag==0:
    print("Yes")
else:
    print("No")
N = int(input())
plan = [[0]*3 for i in range(N+1)]
for i in range(1,N+1):
    plan[i][0],plan[i][1],plan[i][2] = map(int,input().split())

flag = 0

for i in range(N):
    dt = 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 dt < dist or dt%2 != dist%2:
        print("No")
        flag = 0
        break
    else:
        flag = 1

if flag == 1:
    print("Yes")
N = int(input().strip())
route = [tuple(map(int, input().strip().split(" "))) for i in range(N)]

start = (0, 0, 0)
goal = True

for r in route:
    t = r[0] - start[0]
    d = abs(r[1]-start[1]) + abs(r[2]-start[2])
    if d % 2 == t % 2 and t >= d: # match even/odd and can reach dest in time
        pass
    else:
        goal = False
        break
    start = r

if goal:
    print("Yes")
else:
    print("No")
N = int(input())
l = []
now = [0,0,0]
ans = 'Yes'
for _ in range(N):
    inp = list(map(int,input().split()))
    l.append(inp)

for i in range(N):
    shortest = abs(l[i][1] - now[1]) + abs(l[i][2] - now[2])
    if shortest > l[i][0]-now[0]:
        ans = 'No'
        break
    a = l[i][0] -now[0]- shortest
    if a % 2 !=0:
        ans = 'No'
        break
    else:
        now = l[i]
print(ans)
n = int(input())
txy = [list(map(int,input().split())) for _ in range(n)]
txy.insert(0,[0,0,0])
for i in range(n):
  t = txy[i+1][0] - txy[i][0]
  x = abs(txy[i+1][1] - txy[i][1])
  y = abs(txy[i+1][2] - txy[i][2])
  if t < x+y:
    print('No')
    exit()
  elif t == x+y:
    pass
  else:
    if ((t%2 == 0) and ((x+y)%2 == 0)) or ((t%2 != 0)and((x+y)%2 != 0)):
      pass
    else:
      print('No')
      exit()
print('Yes')
import sys
n = int(input())
tourList = {}
#順次移動できるかチェックしていく
nowX = 0
nowY = 0
nowTime = 0
for i in range(n):
  t,x,y = map(int,input().split())  
  moveX = abs(x - nowX)
  moveY = abs(y - nowY)
  moveTime = moveX+moveY
  reachTime = moveTime + nowTime
  if reachTime > t or (t-reachTime) % 2 != 0:
    print('No')
    sys.exit()
  nowTime = t
  nowX = x
  nowY = y
print('Yes')
n=int(input())
u=0
p=0
q=0
for _ in range(n):
  t,x,y=map(int,input().split())
  if abs(p-x)+abs(q-y)<=t-u and (t-u-abs(p-x)-abs(q-y))%2==0:
    u=t
    p=x
    q=y
  else:
    print('No')
    break
else:
  print('Yes')
import sys
input = sys.stdin.readline

n = int(input())
t = 0
x = 0
y = 0
judge = True

for i in range(n):
    t1, x1, y1 = map(int, input().split())
    if (abs(x1 - x) + abs(y1 - y))/(t1 - t) > 1 or (abs(x1 - x) + abs(y1 - y))%2 != (t1 - t)%2:
        judge = False
    x = x1
    y = y1
    t = t1

if judge == True:
    print("Yes")
else:
    print("No")
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')
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import numpy as np

N = int(input())
prev_dst = [0,0,0]

for n in range(N):
    t, x, y = map(int, input().split(" "))
    a = (t - prev_dst[0]) - (np.abs(prev_dst[1]-x) + np.abs(prev_dst[2]-y))
    if a >= 0 and a % 2 == 0:
        prev_dst = [t, x, y]
    else:
        print("No")
        exit(0)

print("Yes")
N = int(input())
nowx = 0
nowy = 0
nowt = 0

result = 'Yes'
for i in range(N):
  [t, x, y] = list(map(int,input().split(' ')))
  if (t - nowt) >= abs(x - nowx) + abs(y - nowy) and ((t - nowt) - (x - nowx) - (y - nowy)) % 2 == 0:
    nowx = x
    nowy = y
    nowt = t
    continue
  else:
    result = 'No'
    break
    
print(result)
n=int(input())

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

x=0
y=0
t=0
for item in posi:
  temp=abs(x-item[1])+abs(y-item[2])
  #print(t,x,y,item)
  if item[0]-t<temp:
    #print("error")
    print("No")
    exit()
  flag=(item[0]-t-temp)%2
  #print("flag",flag)
  if flag==0:
    #print("hoge")
    t=item[0]
    x=item[1]
    y=item[2]
  else:
    print("No")
    exit()
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)
N = int(input())
t_pre, x_pre, y_pre = 0, 0, 0
flag = True
for i in range(N):
    t, x, y = map(int, input().split())
    delta_t = t - t_pre
    delta_x = abs(x - x_pre)
    delta_y = abs(y - y_pre)
    if t % 2 != (x + y) %2:
        flag = False
        break
    if delta_x + delta_y > delta_t:
        flag = False
        break
if flag:
    print('Yes')
else:
    print('No')
def main():
    n = int(input())
    txy = [list(map(int, input().split())) for _ in range(n)]
    
    pre_x, pre_y, pre_t = 0, 0, 0
    for t, x, y in txy:
        d = abs(pre_x - x) + abs(pre_y - y)
        if not(t - pre_t >= d and (t - pre_t) % 2 == d % 2):
            print('No')
            break
        pre_x,  pre_y, pre_t = x, y, t
    else:
        print('Yes')
        
        
if __name__ == '__main__':
    main()