peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())
T, points= [],[]
for i in range(N):
    t,x,y = map(int, input().split())
    T.append(t)
    points.append([x,y])
    
flag = False
t_now = x_now = y_now = 0
for i in range(N):
    t_diff = T[i] - t_now
    d_diff = abs(points[i][0]-x_now) + abs(points[i][1]-y_now)
    if t_diff-d_diff>=0 and (d_diff-t_diff)%2==0:
        flag = True
    t_now = T[i]
    x_now = points[i][0]
    y_now = points[i][1]

print("Yes") if flag else print("No")
n = int(input())
txy = [list(map(int, input().split())) for i in range(n)]

x = 0
y = 0
t = 0
for i in range(n):
    sub = abs(txy[i][1] - x) + abs(txy[i][2] - y)
    if not ((txy[i][0] - t == sub) or (txy[i][0] - t > sub and (txy[i][0] - t) % 2 == 0)):
        print("No")
        exit()

print("Yes")
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 = abs(t0 - t)
    if abs(kyori - time) % 2 == 0 and kyori - time < 0:
        t0, x0, y0 = t, x, y
    else:
        print('No')
        exit(0)
print('Yes')
n = int(input())
t,x,y = map(int,input().split())

No = 0

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

if No == 0:
    print("Yes")
else:
    print("No")
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())
prev_point = (0, 0)
prev_time = 0
for i in range(n):
    t, x, y = map(int, input().split())
    dist = abs(x - prev_point[0]) + abs(y - prev_point[1])
    if dist > t:
        print('No')
        sys.exit(0)

    if (t - prev_time) % 2 != dist % 2:
        print('No')
        sys.exit(0)
print('Yes')
import sys
n = int(input())
lis = [list(map(int,input().split())) for _ in range(n)]
t = 0
x = 0
y = 0
for i in range(n):
    if lis[i][0] % (lis[i][1] + lis[i][2]) == 0 and (lis[i][0] - t >= lis[i][1]-x + lis[i][2]-y):
        x = lis[i][1]
        y = lis[i][2]
        t = lis[i][0]
    else:
        print("No")
        sys.exit()
print("Yes")
N=int(input())
pos=[0,0]
now=0
flag=True
for i in range(N):
  t,x,y=map(int,input().split())
  d = abs(x-pos[0])+abs(y-pos[0])
  if d>t:
    flag=False
    break
  else:
    if d%2==0:
      now=t
      pos[0],pos[1]=x,y
    else:
      flag=False
      break
if flag:
  print("Yes")
else:
  print("No")
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]) + abs(A[2])) % 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 = abs(x[i+1]-x[i])
    y_diff = abs(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())
txy = [tuple(map(int, input().split())) for _ in range(N)]

tp = xp = yp = 0
for t, x, y in txy:
  ti = t - tp
  d = abs(x - xp) + abs(y - yp)
  if ti < d:
    print('No')
    exit()
  else:
    if ti % 2 != d % 2:
      print('No')
      exit()
    else:
      continue
    
print('Yes')
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:
        count += 0
        break
    else:
        if sum(b)%2 == t%2:
            count += 1
        else:
            count += 0
            break
print("Yes" if count != 0 else "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())

d=abs(x)+abs(y)

if all(t%2==(x+y)%2) and all(t>=(x+y)) and all(d<=t):
    print("Yes")
else:
    print("No")
n = int(input())
m = {}
for i in range(n):
    a = list(map(int, input().split()))
    m[a[0]] = [a[1], a[2]]
t = 0
cood = [0,0]
fail = False
for k,v in m.items():
    diff = abs(cood[0] - v[0]) + abs(cood[1] - v[1])
#     st()
#     print(diff)
    if (k-t >= diff) & ((k-t-diff) % 2 == 0):
        cood = v
        t = k
    else:
        fail = True
        break
if fail:
    print('No')
else:
    print('Yes')
N=int(input())
pre_t=0
flg=0
for i in range(N-1):
    t,x,y=map(int,input().split())
    t_tmp = t
    t=t-pre_t
    pre_t=t_tmp
    if((x+y)%t != 0):
        flg=1
        break
if(flg == 0):
	print("Yes")
else:
	print("No")
N = int(input())
t = [0] * (N + 1)
x = [0] * (N + 1)
y = [0] * (N + 1)

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

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

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

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]):
        ans=1
        
    start=cont
        
if ans==0:
    print('Yes')
    
else:
    print('No')
N = int(input())
L = [list(map(int, input().split())) for i in range(N)]
L.insert(0, [0,0,0])

cnt = 0

for l in range(len(L)-1):
    length = (L[l+1][1] - L[l][1] + L[l+1][2] + L[l][2]) - (L[l+1][0] - L[l][0]) 
    if not (length <= 0 and length % 2 == 0):
        print("No")
        break
    else:
        cnt += 1

if cnt == len(L) - 1:
    print("Yes")
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 or time%2!=dist%2:
        flg = False
        print('No')
        break
    bt, bx, xy = t, x, y
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 + t)%2) != 0 :
        print('No')
        exit()
print('Yes')
N=int(input())
flag='Yes'
for _ in range(N):
  t,x,y=map(int,input().split())
  a=x+y
  if a<=t:
    if (t-a)%2!=0:
      flag='No'
      break
  else:
    flag='No'
    break
print(flag)
n = int(input())
t,x,y = map(int,input().split())

No = 0

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

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

t_pre, x_pre, y_pre = 0, 0, 0
reachable = True
for point in points:
    t, x, y = map(int, point)
    diff_t = t - t_pre
    p = x + y
    p_pre = x_pre + y_pre
    move = 0
    for _ in range(diff_t):
        move += 1 if p > (p_pre + move) else -1

    if p - p_pre != move:
        reachable = False
        break

    t_pre, x_pre, y_pre = t, x, y
N = int(input())
X,Y = 0,0
T = 0
for i in range(N):
  t,x,y = map(int,input().split())
  dist = abs(X-x)+abs(Y-y)
  if (T-t)%2 ==dist%2:
    X += x
    Y += y
    T += t
    pass
  else:
    print("No")
    exit()
print("Yes")
n = int(input())
t1 = 0
x1 = 0
y1 = 0
count = 0
for _ in range(n):
    t,x,y = map(int,input().split())
    t = t - t1
    x = x - x1
    y = 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())
plan = [list(map(int, input().split())) for i in range(N)]
m = 0
for i in range(N-1):
    time = plan[i+1][0]-plan[i][0]
    dist = abs(plan[i+1][1]-plan[i][1])+abs(plan[i+1][2]-plan[i][2])
    if dist>time:
        m = 1
        break
    else:
        if dist%2 == time%2: 
            continue
print('Yes' if m==0 else 'No')
# 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])
	print(d)
	dt = t[i + 1] - t[i]
	if dt < d or (dt - d) % 2 == 1:
		print("No")
		sys.exit()
	
print("Yes")
before = 0, 0, 0
for _ in range(int(input())):
    tt, tx, ty = map(int, input().split())
    bt, bx, by = before
    distance = abs(tx - bx) + abs(ty - by)
    t = tt - bt
    if tt <= distance or t % 2 != distance % 2:
        break
    before = tt, tx, ty
else:
    print('Yes')
    exit()
print('No')
for _ in range(int(input())):
  t, x, y = map(int,input().split())
  if (t+x+y)%2 + (t<x+y):
    s = 0
    break
  s = 1
print("YNeos"[s::2])
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)+abs(yi) <= ti and ti%2 == (xi+yi)%2):
        print('No')
        exit()
print('Yes')
N = int(input())

ans = 'Yes'
for _ in range(N):
    t, x, y = map(int, input().split())
    if t < (x+y):
        ans = 'No'
    if t%(x+y) != 0:
        ans = 'No'

print(ans)
N = int(input())

T = 0
X = 0
Y = 0

for i in range(N):
    t, x, y = map(int, input().split())
    dt = t - T
    dx = abs(X - x)
    dy = abs(Y - y)
    dis = dx + dy
    if dt < dis:
        print("No")
        break
    if (dt - dis) % 2 == 1:
        print("No")
        break
else:
    print("Yes")
import sys
from itertools import combinations
import math


def I(): return int(sys.stdin.readline().rstrip())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


def S(): return sys.stdin.readline().rstrip()


def LS(): return list(sys.stdin.readline().rstrip().split())


N = I()
prev_t = 0
prev_x = 0
prev_y = 0
for i in range(N):
    t, x, y = LI()
    if (x+y) > (t - prev_t) or (abs(prev_x-x) + abs(prev_y-y) + (t - prev_t)) % 2:
        print('No')
        exit()
    prev_t = t
    prev_x = x
    prev_y = y
print('Yes')
N = int(input())

for _ in range(N):
    t,x,y = map(int,input().split())
    if x+y > t or t % 2 != (x+y) % 2:
        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 = x_now - x_bef
    y = 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())
kot="Yes"
for i in range(n):
  a=list(map(int,input().split()))
  
  gou=max(a[1]+a[2],(-1*a[1])+a[2],a[1]+(-1*a[2]),(-1*a[1])+(-1*a[2]))
  if a[0]%2!=(gou)%2:
    kot="No"
    break
  if a[0] < gou:
    kot="No"
    break

print(kot)
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:
        i = i
    else:
        print("No")
        exit()
        
print("Yes")
n = int(input())

def enable_move(old_pos, new_pos):
    old_t, old_x, old_y = old_pos
    new_t, new_x, new_y = new_pos
    t = new_t - old_t
    d = (new_x - old_x) + (new_y - old_y)
    if t < d:
        return False
    return ((t - d) % 2 == 0)

ans = "Yes"
old_pos = [0, 0, 0]
for _ in range(n):
    new_pos = [int(s) for s in input().split()]
    if not enable_move(old_pos, new_pos):
        ans = "No"
        break
    old_pos = new_pos
print(ans)
# AtCoder Beginner Contest 086
# C - Traveling

N=int(input())

T=0
X,Y=0,0

for i in range (N):
    t, x, y =map(int,input().split())
    time =t-T
    distance=(x+y)-(X+Y)
    if time >= distance and time%2==distance%2:
        T=t
        X,Y=x,y
    else :
        print("No")
        exit()

print("Yes")
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) or (dt % 2 == 1 and dist % 2 == 1):
        judge = True
if judge:
    print("Yes")
else:
    print("No")
N = int(input())
A = [input().split() for _ in range(N)]

if N ==1:
  n = int(A[0][0])
  move = int(A[0][1]) + int(A[0][2]) 
  if move > n or move%2 != n%2:
    print("NO")
  else:
    print("YES")
  
for i in range(1,N):
  H = abs(int(A[i][1]) - int(A[i -1][1]))
  V = abs(int(A[i][2]) - int(A[i -1][2]))
  move = H + V
  n = int(A[i][0]) - int(A[i -1][0])
  if move > n or move%2 != n%2:
    print("NO")
    break
  elif i == N -1:
    print("YES")
N = int(input())
prev_t = 0
for i in range(N):
    t,x,y = map(int, input().split())
    if (x+y) > t - prev_t or (x+y)%2 != (t-prev_t)%2:
        print('No')
        exit()
    prev_t = t
print('Yes')
n = int(input())

#[～][0] =>t [1]=>x [2]=>y
l = [list(map(int,input().split())) for i in range(n)]

judge = "No"

#初期値
l.insert(0,[0,0,0])
for i in range(n):
    #奇数がT偶数がF
    n_j = (l[i+1][0]-l[i][0])%2==1
    xy = (l[i+1][1]+l[i+1][2])-(l[i][1]+l[i][2])
    if n_j==xy%2 & n_j>=xy:
        judge = "Yes"
    else:
        judge ="No"
        break
print(judge)
N = int(input())
now_t, now_x, now_y = (0, 0, 0)

for _ in range(N):
  t, x, y = list(map(int, input().split()))
  if (abs(now_x - x) + abs(now_y - y) - now_t) % 2:
    print("No")
    break
else:
  print("Yes")
N = int(input())
txy = [list(map(int, input().split())) for _ in range(N)]

now_x, now_y = 0, 0
pre_t = 0

for t, x, y in txy:
    walk = abs(now_x - x) + abs(now_y - y)
    if t - pre_t < walk:
        print('No')
        exit()
    if (t-pre_t) % 2 != walk % 2:
        print('No')
        exit()

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
    t1,x1,y1 = t2,x2,y2
if flag==0:
    print("Yes")
else:
    print("No")
n = int(input())

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

now = [0,0]

for d in data:
  t, x_now, y_now = [int(i) for i in d.split()]
  x = x_now - now[0]
  y = y_now - now[1]
  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()
  now = [x_now, y_now]
print('Yes')
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:
    t1,x1,y1 = T[i] 
#     t2,x2,y2 = T[i+1]
#     t2,x2,y2 = T[i]
#     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())
T = [0]
X = [0]
Y = [0]
for n in range(N):
  t,x,y = map(int,input().split())
  T.append(t)
  X.append(x)
  Y.append(y)

for n in range(N):
  D = X[n+1]+Y[n+1]-X[n]-Y[n]
  if T[n+1]-T[n] == D:
    pass
  elif T[n+1]-T[n]>D and (T[n+1]-T[n]-D)%2==0:
    pass
  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) >(x+y+t)%2:
        print("No")
        exit()
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
    t1,x2,y2 = t1,x1,y1
if flag==0:
    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[0]) + abs(l[i][2] - now[1])
    if shortest > l[i][0] - now[0]:
        ans = 'No'
        break
    a = l[i][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):
  d=txy[i+1][1]-txy[i][1]+txy[i+1][2]-txy[i][2]
  t=txy[i+1][0]-txy[i][0]
  if t-d<0 or d%2==0:
    print("No")
    exit()
print("Yes")
N = int(input())

nx = 0
ny = 0
nt = 0
for _ in range(N):
    t, x, y = map(int, input().split())
    k = abs(nx-x)+abs(ny-y)
    if k > t:
        print("No")
        break
    if (k-t)%2 != 0:
        print("No")
        break
else:
    print("Yes")
n = int(input())
m = {}
for i in range(n):
    a = list(map(int, input().split()))
    m[a[0]] = [a[1], a[2]]
t = 0
cood = [0,0]
fail = False
for k,v in m.items():
    diff = abs(cood[0] - v[0]) + abs(cood[1] - v[1])
#     st()
#     print(diff)
    if (k >= diff) & ((k-diff) % 2 == 0):
        cood = v
        t = k
    else:
        fail = True
        break
if fail:
    print('No')
else:
    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())

for i in range(N):
    t_diff = t[i+1]-t[i]
    diff = abs(x[i+1]-x[i]) +  abs(y[i+1]-y[i])
    if t_diff%2 != diff%2 or t[i+1] < (x[i+1]+y[i+1]):
        print("No")
        exit()
print("Yes")
n = int(input())

flag = 0

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

if flag > 0:
  print("No")
else:
  print("Yes")
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:
    t1,x1,y1 = T[i] 
    i += 1        
print(flag)
N = int(input())
a = []
for i in range(N):
  a.append(list(map(int,input().split())))
  
ans = []  
for i in range(N):  
  if a[i][0]<a[i][1]+a[i][2]:
    print("No")
    exit()
    
  if a[i][0]%2==1 and (a[i][1]+a[i][2])%2==1:
    ans.append("Yes")
  elif a[i][0]%2==0 and (a[i][1]+a[i][2])%2==0:
    ans.append("Yes")
  else:
    ans.append("No")
    
if ans.count("Yes")==N:
  print("Yes")
else:
  print("No")
n = int(input())
ans = "Yes"
now_x = 0
now_y = 0
now_t = 0

for i in range(n):
  x,y,t = 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())
txy = [tuple(map(int, input().split())) for _ in range(N)]

for t, x, y in txy:
  if t < x + y:
    print('No')
    exit()
  else:
    if t % 2 != (x + y) % 2:
      print('No')
      exit()
    else:
      continue
    
print('Yes')
n=int(input())
for i in range(n):
 t,x,y=map(int, input().split())
 dist=abs(t+1-t)
 dt=abs(x+1-x)+abs(y+1-y)
 if dist<dt or (dist%2) != (dt%2):
  print("No")
  exit()
  
print("Yes")
n = int(input())

ans = 0
for q in range(n):
    limit, x, y = map(int, input().split())
    if (limit < x + y) or (limit - x - y) % 2 != 0:
        ans += 1


print("NO" if ans else "YES")
n = int(input())
t,x,y = 0,0,0
for i in range(n):
    T,X,Y = map(int,input().split())
    dt,dx,dy = T-t,X-x,Y-y
    if dt - (dx + dy) < 0 or (dt - (dx + dy))%2 == 1:
        print("No")
        exit()
    t,x,y = T,X,Y

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())

cnt = 0
while cnt < N:
    dt = t[cnt+1]-t[cnt]
    dxy = x[cnt+1]+y[cnt+1]-x[cnt]-y[cnt]
    
    if dxy > dt or dt%2 != dxy%2:
        print("No")
        exit()
        
    cnt += 1
else:
    print("Yes")
N = int(input())
flag = True
for i in range(N):
    t,x,y = map(int,input().split())
    if t < x+y:
        flag = False
    if t%2 != 0 and (x+y)%2 == 0:
        flag = False
    elif t%2 == 0 and (x+y)%2 != 0:
        flag = False

if flag:
    print('Yes')
else:
    print('No')
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 = [input() for i in range(N)]
txy = [list(map(int, txy[i].split())) for i in range(N)]
ans = "Yes"
for i in range(1,N):
    if(boolean(txy[i-1],txy[i])):
        ans = "No"
        break
print(ans)
num_list=int(input())
a=[1,0,0]
for i in range(num_list):
  b=[int(x) for x in input().split()]
  print("i=",i,"a=",a,"b=",b)
  dt=(b[0]-a[0])
  d=(abs(b[1]-a[1])+abs(b[2]-a[2]))
  if d<=dt and d != 0 and dt%2==d%2:
    if i == num_list-1:
      print("Yes")
      break
    a=b
  else:
    print("No")
    break
n=int(input())
old_t = 0
old_x = 0
old_y = 0
for i in range(n):
  t, x, y = map(int, input().split())
  if (t - old_t) < abs(x-old_x)+abs(y-old_y) or (t - old_t)%2 != (abs(x-old_x)+abs(y-old_y))%2:
    print("No")
    break
else:
  print("Yes")
N = int(input())

pt, px, py = map(int, input().split())
for _ in range(1, N):
    t, x, y = map(int, input().split())
    ts = abs(t - pt)
    xys = abs(x - px) + abs(y - py)
    if ts < xys:
        print('No')
        break

    if ts % 2 != xys % 2:
        print('No')
        break
    
    pt, px, py = t, x, y
else:
    print('Yes')
print('YNeos'[any(t+x+y&1|(t<x+y)for t,x,y in zip(*[map(int,[*open(0)][1].split())]*3))::2])
N=int(input())

for i in range(N):
    t,x,y = map(int,input().split())
    z=x+y
    if ((z+t)%2 == 0) & (abs(z)<=t):
        continue
    else:
        print("No")
        exit()
print("Yes")
n=int(input())
a=[]
for _ in range(n):
  a.append([int(i) for i in input().split()])
b=[0,0,0]
for i in range(n):
  minC=abs(a[i][1]-b[1])+abs(a[i][2]-b[2])
  if a[i][0]-b[0]<minC or (a[i][0]-b[0]-minC)%2==1:
    print("No")
    break
else:
  print("Yes")
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)

input = sys.stdin.readline

setrecursionlimit(1000000)


def main():
	current = [0,0,0]
	flag = True
	for i in range(int(input())):
		c = list(map(int,input().split()))
		mh = abs(c[1]-current[1]) + abs(c[2]-current[2])
		if(abs(c[0]-current[0])%2 != mh%2):
			flag = False
		current = c
	if flag:
		print('Yes')
	else:
		print('No')
main()
N = int(input())
for i in range(N):
  t, x, y = map(int, input().split())
# x+y > t　No
# x+y とtの偶奇が違うならNo
# ここを思いつけば勝ち！
  if ((x+y) > t) or ((x+y +t)%2):
    print("No") 
    exit()
  print("Yes")
n=int(input())
a=[list(map(int,input().split())) for _ in range(n)]
x=y=t=0
ans='Yes'
for i in range(n):
  xy=a[i][1]+a[i][2]-(x+y)
  if xy>a[i][0]-t:
    ans='No'
    break
  else:
    if xy%2!=(a[i][0]-t)%2:
      ans='No'
      break
  x=a[i][1]
  y=a[i][2]
  t=a[i][0]
print(ans)
N = int(input())
TXY = [list(map(int,input().split())) for _ in range(N)]

now = (0,0)
now_t = 0
ok = True
for t,x,y in TXY:
  d = abs(x-now[0]) + abs(y-now[0])
  if d <= (t-now_t) and ((t - now_t) - d) % 2 == 0:
    now = (x,y)
    now_t = t
    continue
  ok = False
  break
  
if ok:
  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())
    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())

#[～][0] =>t [1]=>x [2]=>y
l = [list(map(int,input().split())) for i in range(n)]

judge = "No"

#初期値
l.insert(0,[0,0,0])
for i in range(n):
    #奇数がT偶数がF
    n_j = (l[i+1][0]-l[i][0])%2==1
    xy = (l[i+1][1]+l[i+1][2])-(l[i][1]+l[i][2])
    if n_j==xy%2 & n_j>=xy:
        judge = "Yes"
    else:
        judge ="No"
        break
n = int(input())
txy = [list(map(int,input().split())) for _ in range(n)]
t = txy[0][0]
go = txy[0][1] + txy[0][2]
if t < go or t%2 != go%2:
    print("No")
    exit()
for i in range(n-1):
    t = txy[i+1][0] - txy[i][0]
    go = txy[i+1][1] + txy[i+1][2] - txy[i][1] - txy[i][2]
    if t < go or t%2 != go%2:
        print("No")
        exit()
print("Yes")