peterverebics/CodeNet_Python_118 huggingface dataset:
N=int(input())

t = [0]
x = [0]
y = [0]
for i in range(N):
    t1,x1,y1=[int(i) for i in input().split()]
    t.append(t1)
    x.append(x1)
    y.append(y1)

flag=True

for i in range(N):
    zahyo=abs(x[i]-x[i+1])+abs(y[i]-y[i+1])
    jikansa=t[i+1]-t[i]
    if zahyo<=jikansa and zahyo%2==jikansa%2:
        continue
    else:
        flag=False
        break

if flag:
    print('Yes')
else:
    print('No')
N = int(input())

t=x=y=0

for _ in range(N):
    ti,xi,yi = map(int,input().split())
    T = ti-t
    X = xi-x
    Y = yi-y
    if ((T%2==0 and (X+Y)%2==0) or (T%2==1 and (X+Y)%2==1)) and T >= abs(X+Y):
        t=ti
        x=xi
        y=yi
    else:
        print('No')
        break
else:print('Yes')
N, = map(int, input().split())
tt, aa, bb = 0, 0, 0
for i in range(N):
    t, a, b = map(int, input().split())
    if abs(a-aa) + abs(b-bb) > t - tt or (abs(a-aa) + abs(b-bb) + t - tt) % 2 != 0:
        print("No")
        break
    tt, aa, bb = t, a, b
else:
    print("Yes")
n = int(input())
t, x, y = [0]*(n+1), [0]*(n+1), [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):
    a = abs(t[i] - t[i-1])
    b = abs(x[i] - x[i-1]) + abs(y[i] - y[i-1])
    if a>=b and a%2 == b%2:
        continue
    else:
        print("No")
        break
else:
    print("Yes")
n = int(input())
x,y,t=0,0,0

for i in range(n):
  mt,mx,my= map(int,input().split())
  ft = mt - t
  fx = abs(x-mx)
  fy = abs(y-my)
  if fx + fy > ft:
    print("No")
    exit()
  elif (ft - (fx + fy)) % 2 == 0:
    pass
  else:
    print("No")
    exit()
  x,y,t=mx,my,mt
print("Yes")
N = int(input())
A = [[0,0,0]]
for i in range(N):
  A.append(list(map(int, input().split())))

flag = True
for i in range(N):
  if not flag:
    break
  time = int(A[i+1][0]) - int(A[i][0])
  dist = abs(A[i+1][1] - A[i][1]) + abs(A[i+1][2] - A[i][2]) # x2-x1 + y2-y1
  if time < dist:
    flag = False
  elif time % 2 != dist % 2:
    flag = False

if flag:
  print('Yes')
else:
  print('No')
import sys

input = sys.stdin.readline

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):
    if abs(x[i] - x[i-1]) + abs(y[i] - y[i-1]) > (t[i] - t[i-1]) or (((t[i] -x[i] -y[i]) % 2) != 0):
        print("No")
        exit()
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())
    
f = True
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:
        f = False
    if dist%2 != dt%2:
        f = False

if f:
    print('Yes')
else:
    print('No')
N=int(input())
Ki=[list(map(int,input().split())) for i in range(N)]
f=False
for i in Ki:
  t,x,y=i
  s=x+y
  if (t%2==0 and s%2!=0) or (t%2!=0 and s%2==0) or t<s:
    f=True
    break
if f:
  print('No')
else:
  print('Yes')
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])
	move = (P[i+1][0]-P[i][0]) - norm
	if ((move%2 != 0) or (move < 0)):
		ans = "No"
		break
	
print(ans)
n = int(input())
flag = True
dx, dy, dt = 0, 0, 0

for _ in range(n):
    t, x, y = map(int, input().split())
    dist = abs(dx - x) + abs(dy - y)
    if t - dt < dist or (t - dt - dist) % 2:
        flag = False
    dt, dx, dy = t, x, y

print("Yes" if flag else "No")
def boolean(a,b):
    D = abs(a[0] - b[0]) -abs(a[1] - b[1]) - abs(a[2] - b[2])
    if(D >= 0 and D %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())
D = [[0, 0, 0]] + [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
else:
  print('Yes')
def resolve():
  n = int(input())
  plan = []
  for i in range(n):
    t, x, y = map(int, input().split())
    plan.append((t, x, y))

  t = 0
  x = 0
  y = 0

  for p in plan:
    time = p[0] - t
    l = abs(x - p[1]) + abs(y - p[2])
    if l > time or l % 2 != time % 2:
      print('No')
      return
    t, x, y = p

  print('Yes')

  return

if __name__ == "__main__":
  resolve()
n = int(input())
t,x,y = 0,0,0
for i in range(n):
  nt, nx, ny  = map(int, input().split())
  if not(abs(nx-x)+abs(ny-y) <= nt-t and t%2 == (x+y)%2):
    print("No")
    exit()
  t,x,y = nt,nx,ny
print("Yes")
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
flag = True
for i in range(n):
    t,x,y = iim()
    if x+y > t or t%2 != (x+y)%2:
        flag = False

print('Yes' if flag else 'No')
N=int(input())
pre_t,pre_x,pre_y=0,0,0
reachable=True
for _ in range(N):
  t,x,y=map(int,input().split())
  dist=abs(x-pre_x)+abs(y-pre_y)
  time=t-pre_t
  if dist<=time:
    if dist%2==time%2:
      pre_t,pre_x,pre_y=t,x,y
    else:
      reachable=False
      break
  else:
    reachable=False
    break
  pass
if reachable:print('Yes')
else: print('No')
N = int(input())
txy = [map(int, input().split()) for _ in range(N)]

for t, x, y in txy:
    dist = x + y
    if t < dist or t % 2 != dist % 2:
        print('No')
        exit()
print('Yes')
if __name__ == '__main__':
    l_c = int(input())
    trips = []
    for i in range(l_c):
        trips.append([int(v) for v in input().split(' ')])
    pos = [0, 0, 0]
    for t in trips:
        time = t[0] - pos[0]
        dist = abs(pos[1] - t[1]) + abs(pos[2] - t[2])
        e_or_o = [time % 2, dist % 2]
        if time < dist or e_or_o[0] != e_or_o[1]:
            print('No')
            exit(0)
        pos = t
    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]
  
  if dt < abs(dx + dy):
    print('No')
    break
  else:
    if (dt - (dx + dy)) % 2 != 0:
      print('No')
      break
else:
  print('Yes')
N = int(input())

now = [0, 0]
for i in range(N):
  t, x, y = map(int, input().split())
  time = abs(x - now[0]) + abs(y - now[1])
  if t >= time and (t - time)%2==0:
    continue
  print('No')
  quit()

print('Yes')
N=int(input())
t0=0
x0=0
y0=0
for i in range(N):
  t,x,y = map(int, input().split())
  l = abs(x-x0) + abs(y-y0)
  if (l > (t-t0)) or (l%2 != (t-t0)%2):
    print("No")
    break
  else:
    x0 = x
    y0 = y
    t0 = t
else:
  print("Yes")
n = int(input())
l = [[0, 0, 0]] + list(list(map(int, input().split())) for i in range(n))

for i in range(1, n+1):
    dt = l[i][0] - l[i-1][0]
    dx = abs(l[i][1] - l[i-1][1])
    dy = abs(l[i][2] - l[i-1][2])
    
    tmp = dt - dx - dy
    if tmp < 0 or tmp % 2 == 1:
        print('No')
        break
else:
    print('Yes')
import sys
n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
x = 0
y = 0
t = 0
for i in range(n):
    if abs(a[i][1] - x) + abs(a[i][2] - y) > abs(a[i][0] - t) or (a[i][1] - x + a[i][2] - y) % 2 != (a[i][0] - t) % 2:
        print('No')
        sys.exit()
    else:
        x = a[i][1]
        y = a[i][2]
        t = a[i][0]
print('Yes')
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 = 0
    px = 0
    py = 0
    for t, x, y in TXY:
        move = abs(py-y) + abs(px - x)
        if (t-time) < move or (t - time) % 2 != move % 2:
            return print("No")
        time = t
        px = x
        py = y
    print("Yes")


if __name__ == '__main__':
    main()
n = int(input())
tt = [0]
xx = [0]
yy = [0]
for i in range(n):
    t,x,y = map(int,input().split())
    tt.append(t)
    xx.append(x)
    yy.append(y)
ans = "Yes"

for i in range(1,n+1):
    dist = abs(xx[i]-xx[i-1]) + abs(yy[i]-yy[i-1])
    time = tt[i]-tt[i-1]
    if time < dist or (time - dist)%2 != 0:
        ans = "No"
        break

print(ans)
N=int(input())
count=0
for i in range(N):
	T,X,Y=map(int,input().split())
	if T%2==(X+Y)%2 and T>=(X+Y):
		count+=1
if count==N:
	print("Yes")
else:
	print("No")
from sys import exit
N = int(input())
posx = 0
posy = 0
now = 0
for _ in range(N):
    t, x, y = map(int, input().split())
    time_elapsed = t - now
    now = t
    if abs(posx - x) + abs(posy - y) <= time_elapsed and time_elapsed % 2 == (abs(posx - x) + abs(posy - y)) % 2:
        posx = x
        posy = y
    else:
        print("No")
        exit()
print("Yes")
n = int(input())
pt = 0
px, py = 0, 0
f = True
for i in range(n):
    t, x, y = map(int, input().split())
    dis = abs(px-x) + abs(py-y)
    dt = t - pt
    #print("dis{0} dt = {1}".format(dis, dt))
    if dt >= dis and abs(dis - dt) % 2 == 0:
        pass
    else:
        f = False
    pt, px, py = t, x, y
print("Yes" if f else "No")
n = int(input())
t = 0
x = 0
y = 0
for i in range(n):
    t_in,x_in,y_in = map(int,input().split())
    diff_t = t_in - t
    diff_x = abs(x_in-x)
    diff_y = abs(y_in-y)
    sum_xy = diff_x + diff_y
    if diff_t < sum_xy:
        print('No')
        exit()
    else:
        if diff_t%2 != sum_xy%2:
            print('No')
            exit()
print('Yes')
n = int(input())
t=[0]
x=[0]
y=[0]
for i in range(n):
  t_inp,x_inp,y_inp=(int(x) for x in input().split())
  t.append(t_inp)
  x.append(x_inp)
  y.append(y_inp)
  
flag=True
for i in range(1,n+1):
  dt=t[i]-t[i-1]
  dist=abs(x[i]-x[i-1])+abs(y[i]-y[i-1])
  if dt<dist:
    flag=False
    break
  if dt%2 != dist%2:
    flag=False
    break
    
if flag:
  print("Yes")
else:
  print("No")
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):
    dis = abs(data[i][1] - data[i - 1][1]) + abs(data[i][2] - data[i- 1][2])
    dif = data[i][0] - data[i - 1][0]
    if (dif % 2 != dis % 2 or dis > dif):
        print("No")
        exit() 

print("Yes")
N = int(input())
txy = list(list(map(int, input().split())) for _ in range(N))
dt = 0
dx = 0
dy = 0
for i in range(N):
    if abs(txy[i][1]-dx)+abs(txy[i][2]-dy) > txy[i][0]-dt or (txy[i][1]+txy[i][2])%2 != txy[i][0]%2:
        print("No")
        break
    dt = txy[i][0]
    dx = txy[i][1]
    dy = txy[i][2]
else:
    print("Yes")
import sys
N = int(input())
turn = 0
x, y = 0, 0
for i in range(N):
    a = list(map(int, input().split()))
    if a[0]%2 == 0 and (a[1]+a[2])%2 == 1:
        print("No")
        sys.exit()
    if a[0]%2 == 1 and (a[1]+a[2])%2 == 0:
        print("No")
        sys.exit()
    if (a[0] - turn) < abs(x - a[1]) + abs(y - a[2]):
        print("No")
        sys.exit()
print('Yes')
import sys
input = sys.stdin.readline
n = int(input().strip())
t = 0
x = 0
y = 0
ans = "Yes"
for _ in range(n):
  tn,xn,yn = map(int,input().split())
  if tn%2 != (xn+yn)%2 or abs(xn-x)+abs(yn-y) > (tn - t):
    ans = "No"
    break
print(ans)
#!/usr/bin/env python3
import math
n = int(input())
txy = [map(int, input().split()) for _ in range(n)]
t, x, y = [list(i) for i in zip(*txy)]

gt = 0
gx = 0
gy = 0

for i in range(n):
    wt = t[i] -gt
    ww = abs(x[i] - gx) + abs(y[i] - gy)
    if (wt < ww) or ((wt - ww) % 2 == 1):
        print("No")
        break

    gt = t[i]
    gx = x[i]
    gy = y[i]

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

ans = 'Yes'
for t, x, y in P:
    if x + y > t:
        ans = 'No'
        break
    if (x + y) % 2 != t % 2:
        ans = 'No'
        break

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()
  nowt = t
  nowx = x
  nowy = y
    
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 % 2 == (x+y) % 2:
        count += 1
    T, X, Y = t, x, y
print("Yes" if count == N else "No")
N = int(input())
Inf = [[0,0,0]]

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

for i in range(N):
    dist = abs(Inf[i][1]-Inf[i+1][1]) + abs(Inf[i][2]-Inf[i+1][2])
    dt = Inf[i+1][0] - Inf[i][0]
    if dt < dist:
        print("No")
        break
    else:
        if (dt % 2) == (dist % 2):
            continue
        else:
            print("No")
            break
else:
    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 abs(lim_x)+abs(lim_y)>lim_t or (lim_t-lim_x-lim_y)%2==1:
    print('No')
    exit()
    
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:
    now = next_
    continue
  else:
    print('No')
    exit()
print('Yes')
# 最高で進んでもtを超えることはできない
# 1ターンにつき1進むので偶奇をみる

n = int(input())
pre = [0, 0, 0]  # time, x, y
for i in range(n):
    t, x, y = map(int, input().split())
    t -= pre[0]
    x -= pre[1]
    y -= pre[2]
    if t < abs(x) + abs(y) or (abs(x) + abs(y)) % 2 != t % 2:
        print("No")
        exit()
    pre = [t, x, y]
print("Yes")
N = int(input())
t = [0 for _ in range(N + 10)]
x = [0 for _ in range(N + 10)]
y = [0 for _ in range(N + 10)]
res = 'Yes'
for i in range(N):
  t[i], x[i], y[i] = map(int, input().split(' '))
for i in range(N):
  if abs(x[i]) + abs(y[i]) <= t[i] and (abs(x[i]) + abs(y[i])) % 2 == t[i] % 2:
    x[i + 1] -= x[i]
    y[i + 1] -= y[i]
    t[i + 1] -= t[i]
  else:
    res = 'No'
    break
print(res)
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):
    dist = abs(x[i+1]-x[i]) + abs(y[i+1]-y[i])
    diff = t[i+1]-t[i]
    if dist>diff or dist%2!=diff%2:
        print('No')
        exit()
print('Yes')
N = int(input())
t_x_y = [list(map(int, input().split())) for _ in range(N)]
t_x_y.insert(0, [0, 0, 0])

ans = 'Yes'
for i in range(N):
  dt = t_x_y[i+1][0] - t_x_y[i][0]
  dist = abs(t_x_y[i+1][1] - t_x_y[i][1]) + abs(t_x_y[i+1][2] - t_x_y[i][2])
  
  if dt < dist:
    ans = 'No'
    break
  else:
    # dt >= dist
    if (dt - dist) % 2 != 0:
      ans = 'No'
      break
  
print(ans)
n = int(input())
TP = [[0, 0, 0]]
for _ in range(n):
    TP.append(list(map(int, input().split())))
for i in range(1, n + 1):
    td = TP[i][0] - TP[i-1][0]
    pd = abs(TP[i][1] - TP[i-1][1]) + abs(TP[i][2] - TP[i-1][2])
    if td >= pd and td % 2 == pd % 2:
        continue
    else:
        print('No')
        exit()
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) or ((t - T) + abs(x-X) + abs(y-Y))%2 == 1:
        print("No")
        break
    T = t
    X = x
    Y = y
else:
    print("Yes")
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 or (t - time) % 2 != move % 2:
            return print("No")
        time = t
        posi = [x, y]
    print("Yes")


if __name__ == '__main__':
    main()
import sys
n = int(input())
txy = []
for i in range(n):
  txy.append(list(map(int, input().split())))
pt = 0
py = 0
px = 0
for t, x, y in txy:
  dt = t - pt
  dx = x - px
  dy = y - py
  ax = abs(dx) % 2
  ay = abs(dy) % 2
  a = (ax + ay) % 2
  if abs(dx) + abs(dy) > dt or a != dt % 2:
    print("No")
    sys.exit()
print("Yes")
N = int(input())

TXY = [[0,0,0]]
for n in range(N):
  TXY.append([int(i) for i in input().split()])

ans = "Yes"
for i in range(N):
  sec = TXY[i+1][0] - TXY[i][0]
  length = abs(TXY[i+1][1] - TXY[i][1]) + abs(TXY[i+1][2] - TXY[i][2])

  if sec < length or (sec >= length and (length - sec)%2 == 1):
    ans = "No"
    break

print(ans)
N = int(input())
txy = [tuple(map(int,input().split())) for _ in range(N)]
t = 0
x = 0
y = 0
for i in range(N):
    nt,nx,ny = txy[i]
    t = nt-t
    x = nx-x
    y = ny-y
    d = abs(x)+abs(y)
    if t < d:
        print("No")
        exit(0)
    elif (t-d)%2 == 1:
        print("No")
        exit(0)
    t,x,y = txy[i]
print("Yes")
N = int(input())
currentTime = 0
current = [0, 0]
for i in range(N):
    timeStamp = list(map(int, input().split()))
    reqLen = abs(timeStamp[1] - current[0]) + abs(timeStamp[2] - current[1])
    timeLen = timeStamp[0] - currentTime
    if reqLen > timeLen:
        print("No")
        exit()
    if reqLen % 2 != timeLen % 2:
        print("No")
        exit()
    currentTime = timeStamp[0]
    current = timeStamp[1:]
print("Yes")
n=int(input())
t,x,y=[0],[0],[0]
for i in range(n):
    T,X,Y=map(int,input().split())
    t.append(T)
    x.append(X)
    y.append(Y)
#print(t,x,y)
for i in range(n):
    time=t[i+1]-t[i]
    dx=abs(x[i+1]-x[i])
    dy=abs(y[i+1]-y[i])

    if time<dx+dy or (time+dx+dy)%2!=0:
        print('No')
        exit()
print('Yes')
N = int(input())
t,x,y = 0,0,0

for i in range(N):
  a,b,c = map(int, input().split())
  tmp = abs(a-t) - abs(b-x) - abs(c-y) 
  if tmp >= 0 and tmp % 2 == 0:
    t,x,y = a,b,c
  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 (x+y+t) % 2:
  print("No")
  exit()
print("Yes")
n = int(input())
t = [0]
x = [0]
y = [0]
for _ in range(n):
    T, X, Y = map(int, input().split())
    t.append(T)
    x.append(X)
    y.append(Y)

for num in range(n):
    dif_t = t[num+1] - t[num]
    dif_x = abs(x[num+1] - x[num])
    dif_y = abs(y[num+1] - y[num])
    i = dif_t - (dif_x + dif_y)
    if i%2 == 1 or i <= -1:
        print('No')
        exit()

print('Yes')
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())
time=0
dist=0
for i in range(n):
    dist=abs(x[i+1]-x[i])+abs(y[i+1]-y[i])
    time=t[i+1]-t[i]
    if time>=dist and time%2 == dist%2:
        continue
    else:
        print('No')
        exit()
print('Yes')
def main():
    n = int(input())

    pt, px, py = 0, 0, 0
    for _ in range(n):
        t, x, y = map(int, input().split())
        dt = t - pt
        dx = abs(x - px)
        dy = abs(y - py)
        if (dx + dy) % 2 != dt % 2:
            print('No')
            return
        if (dx + dy) > dt:
            print('No')
            return
    print('Yes')


if __name__ == '__main__':
    main()
N=int(input())
T= [list(map(int,input().split())) for _ in range(N)]

is_able=True
pre_t = 0
pre_x = 0
pre_y = 0
for i in range(len(T)):
  if (T[i][0] % 2) != (T[i][1]+T[i][2])%2:
    is_able=False
    break
  if T[i][0]-pre_t < (T[i][1]-pre_x + T[i][2]-pre_y):
    is_able=False
    break
  pre_t=T[i][0]
  pre_x=T[i][1]
  pre_y=T[i][2]
if is_able:
  print('Yes')
else:
  print('No')
N = int(input())
tpr, xpr, ypr = 0, 0, 0
count = 0
for i in range(N):
    t, x, y = map(int, input().split())
    d = abs(x-xpr) + abs(y-ypr)
    n = ((t-tpr) - d) / 2
    if n >= 0 and n % 1 == 0:
        count += 1
    tpr, xpr, ypr = t, x, y
if count == N:
    print("Yes")
else:
    print("No")
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
    pt, px, py = t, x, y
print('Yes' if can else '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)<= abs(t-now_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())
[t, x, y] = [[0],[0],[0]]
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):
  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")
import math
N = int(input())
T = [0]*110000
X = [0]*110000
Y = [0]*110000

for n in range(N):
    T[n+1], X[n+1], Y[n+1] = map(int, input().split())

res = True
for n in range(N):
    dt   = T[n+1] - T[n]
    dist = abs(X[n+1] - X[n]) + abs(Y[n+1] - Y[n])
    if dt < dist:
        res = False
    if dt % 2 != dist % 2:
        res = False

if res:
    print('Yes')
else:
    print('No')
#!/usr/bin/env python3
# coding=utf-8

import sys

n = int(sys.stdin.readline().strip())

txy = [(0,0,0)]+[tuple(map(int, l.strip().split(" "))) for l in sys.stdin.readlines()]
check_txy = [abs(_x - _xp) + abs(_y - _yp) <= _t - _tp and (_t + _x + _y) % 2 == 0 for (_t, _x, _y), (_tp, _xp, _yp) in zip(txy[1:], txy)]
if all(check_txy):
    print("Yes")
else:
    print("No")
N = int(input())
t0, x0, y0 = 0, 0, 0
for i in range(N):
    t, x, y = map(int, input().split())
    kyori = abs(x - x0) + abs(y - y0)
    time = t - t0
    if (abs(kyori - time)) % 2 == 0 and time - kyori >= 0:
        t0, x0, y0 = t, x, y
    else:
        print('No')
        exit(0)
print('Yes')
n = int(input())
TXY = [(0, 0, 0)]
for i in range(n):
	TXY.append(tuple(map(int, input().split())))
for (t1, x1, y1), (t2, x2, y2) in zip(TXY, TXY[1:]):
	dist = abs(x2 - x1) + abs(y2 - y1)
	d = t2 - t1
	flag = False
	for t in range(d, -1, -2):
		if t == dist:
			flag = True
			break
	if flag == False:
		print("No")
		exit()
else:
	print("Yes")
N = int(input())
dt, dx, dy = 0, 0, 0
avilable = True
for i in range(N):
    t, x, y = map(int, input().split())
    if abs(x-dx)+abs(y-dy) > t-dt or (abs(x-dx)+abs(y-dy)) % 2 != (t-dt) % 2:
        avilable = False
    dt = t
    dx = x
    dy = y
if avilable:
    print('Yes')
else:
    print('No')
#!/usr/bin/env python3
(n, ), *p = [[*map(int, i.split())] for i in open(0)]
t, x, y = 0, 0, 0
for a, b, c in p:
    d = abs(x - b) + abs(y - c) - a + t
    if d <= 0 and d % 2 < 1:
        t, x, y = a, b, c
    else:
        print("No")
        exit()
print("Yes")
N = int(input())

can = True
for i in range(N):
    t, x, y = list(map(int, input().split()))
    
    if not t%2 == (x+y)%2 or (x+y) > t:
        can = False
        break
        
if can:
    s = "Yes"
else:
    s = "No"
print(s)
n = int(input());
told,xold,yold = 0,0,0; 
ans = 'Yes';
for i in range(n) :
    tnew,xnew,ynew = [int(x) for x in input().split()];
    dis = abs(xnew-xold) + abs(ynew-yold);
    diff = tnew - told;
    if (diff - dis)%2 == 1 or diff < dis :
        ans = 'No';
        break;
    else :
        told,xold,yold = tnew,xnew,ynew;

print(ans);
n=int(input())
data=[list(map(int,input().split())) for _ in range(n)]
x_past=0
y_past=0
t_past=0
for t,x,y in data:
  if abs(x-x_past)+abs(y-y_past)>t-t_past:
    print("No")
    exit()
  if (abs(x-x_past)+abs(y-y_past))%2!=(t-t_past)%2:
    print("No")
    exit()
  x_past=x
  y_past=y
  t_past=t
print("Yes")
N = int(input())

current = (0, 0, 0)
for i in range(N):
  ct, cx, cy = map(int, current)
  t, x, y = map(int, input().split())

  v = abs(x-cx) + abs(y-cy)
  if abs(t-ct) < v:
    print("No")
    exit()

  if abs(t-ct) % 2 != v % 2:
    print("No")
    exit()

print("Yes")
N = int(input())
plan = [[0,0,0]]
plan.extend(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')