peterverebics/CodeNet_Python_118 huggingface dataset:
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] >= abs(A[1]) + abs(A[2]) and plcs[i][0] % 2 == (abs(plcs[i][1]) + abs(plcs[i][2])) % 2:
        continue
    else:
        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

print('Yes' if f else 'No')
N = int(input())
t = 0
x = 0
y = 0

for i in range(N):
    tt, xx, yy = map(int,input().split())
    if tt-t>=abs(xx-x)+abs(yy-y) and ((tt-t)-(abs(xx-x)+abs(yy-y)))%2==0:
        t = tt
        x = xx
        y = yy
    else:
        print('No')
        exit()
print('Yes')
n = int(input())
count=0
temp=0
xtemp=0
ytemp=0
for i in range(0,n):
    t,x,y = map(int, input().split())
    if abs(t-temp)>=abs(x-xtemp)+abs(y-ytemp) and (x-xtemp+y-ytemp-(t-temp))%2==0:
        count=count+1
    temp=t
    xtemp=x
    ytemp=y
if count==n:
    print("Yes")
else:
    print("No")
n=int(input())

def func(start,goal,t):
    distance=abs(start[0]-goal[0])+abs(start[1]-goal[1])
    if distance<=t and (t-distance)%2==0:
        return True
    return False
now=0
can=1
start=[0,0]
for i in range(n):
    t,x,y=[int(i) for i in input().split()]
    goal=[x,y]
    if not func(start,goal,t-now):
        can=0
        break
    else:
        start=goal
        now=t

if can==1:
    print("Yes")
else:
    print("No")
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,abs(X-x),abs(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())
a = [[0, 0, 0]]
for _ in range(n):
  a.append(list(map(int, input().split())))

flag = 0
for i in range(n):
  delta = a[i+1][0]-a[i][0]
  distance = abs(a[i+1][1]-a[i][1]) + abs(a[i+1][2]-a[i][2])
  if delta < distance or delta%2 != distance%2:
    flag = 1
    break
    
if flag == 1:
  print("No")
else:
  print("Yes")
N = int(input())
now = [0,0]
tnow = 0
ans = 'Yes'
for i in range(N):
    t,x,y = map(int,input().split())
    dis = abs(x-now[0]) + abs(y-now[1])
    if t-tnow >= dis and (t-tnow)%2 == dis%2:
        tnow = t
        now = [x,y]
    else:
        ans = 'No'
        break
print(ans)
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):
    dt = t[i + 1] - t[i]
    dist = abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i])
    if dt < dist:
        print("No")
        exit(0)

    if dist % 2 != dt % 2:
        print("No")
        exit(0)

print("Yes")
N = int(input())
data = [[int(__) for __ in input().split()] for _ in range(N)]


data.insert(0, [0, 0, 0])
canTravel = True

for i in range(1, N+1):
    absT = abs(data[i][0] - data[i-1][0])
    absX = abs(data[i][1] - data[i-1][1])
    absY = abs(data[i][2] - data[i-1][2])

    distance = absX + absY
    if absT < distance or absT % 2 != distance % 2:
        canTravel = False
        break

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

old_t = 0
old_x = 0
old_y = 0

for _ in range(N):
    t, x, y = list(map(int, input().split()))
    rest_t = t - old_x
    diff = abs(x - old_x) + abs(y - old_y)
    if (rest_t < diff) or (old_t - t + old_x - x + old_y -y) % 2 != 0:
        print("No")
        exit()
    old_t = t
    old_x = x
    old_y = y

print("Yes")
n = int(input())
pre_t, pre_x, pre_y = 0, 0, 0
for i in range(n):
    t , x, y = map(int, input().split())
    dt = t - pre_t
    dist = abs(x - pre_x) + abs(y -pre_y)
    if dist > dt or (dist+dt)%2 != 0:

        print("\nNo") 
        exit()
    pre_t, pre_x, pre_y = t, x, 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())
flag=True
for i in range(n):
    t,x,y=map(int,input().split())
    if x+y>t or t%2!=(x+y)%2:
        flag=False
        break
print("Yes" if flag else "No")
n=int(input())
now=[0,0,0]#t,x,y
f=True
for i in range(n):
    t,x,y=map(int,input().split())
    k=abs(x-now[1])+abs(y-now[2])
    l=abs(t-now[0])
    if not(k<=l and abs(k-l)%2==0):
        f=False
    now=[t,x,y]
print("Yes" if f else "No")
n = int(input())
txy = []
for _ in range(n):
    t, x, y = map(int, input().split())
    txy.append((t, x, y))
px = py = pt = 0
for t, x, y in txy:
    m = abs(x-px)+abs(y-py)
    dt = t-pt
    if m>dt or (dt-m)%2==1:
        print('No')
        break
    px, py, pt = x, y, t
else:
    print('Yes')
n = int(input())
for _ 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):
	nt, nx, ny = map(int,input().split())
	sa = nt-t
	t = nt
	kyori = abs(nx-x) + abs(ny-y)
	x = nx
	y = ny
	if kyori > sa or (sa-kyori) % 2 == 1:
		print("No")
		exit()
print("Yes")
N = int(input())
st = 0
sx = 0
sy = 0
flg = False
for _ in range(N):
    t,x,y = map(int,input().split())

    if abs((x+y)-(sx+sy)) > (t-st) or (t-st) % 2 != abs((x+y)-(sx+sy)) % 2:
        flg = True
        break
    else:
        st = t
        sx = x
        sy = y
print('No' if flg else 'Yes')
import sys
input = sys.stdin.buffer.readline #inputに置き換え可能

n = int(input())
txy = [[0,0,0]] + [list(map(int,input().split())) for i in range(n)]

flg = True
for i in range(1, n+1):
    dt = txy[i][0] - txy[i-1][0] 
    dx = abs(txy[i][1] - txy[i-1][1])
    dy = abs(txy[i][2] - txy[i-1][2])
    dxdy = dx + dy
    if dt % 2 != dxdy % 2 or dt < dxdy:
        flg = False
        break
print('Yes') if flg else print('No')
n = int(input())
li = []
pre_t = 0
pre_x = 0
pre_y = 0
flag = True

for i in range(n):
    t,x,y = map(int,input().split())
    if (t-pre_t)%2 == (x-pre_x+y-pre_y)%2 and (t-pre_t) >= (x-pre_x + y-pre_y):
        pre_t = t
        pre_x = x
        pre_y = y
    else:
        flag = False
        break
if flag:
    print("Yes")
else:
    print("No")
n=int(input())
s = [[0,0,0]]
for i in range(n):
    s.append(list(input().split()))

for i in range(1,len(s)):
    dt=int(s[i][0])-int(s[i-1][0])
    dx=int(s[i][1])-int(s[i-1][1])
    dy=int(s[i][2])-int(s[i-1][2])

    if dt<abs(dx)+abs(dy):
        print("No")
        exit()

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

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])
    duration = t[index] - t[index - 1]
    if duration < distance or duration % 2 != distance % 2:
        print("No")
        break
else:
    print("Yes")
n = int(input())

p, sx, sy = 0, 0, 0
for i in range(n):
    t, x, y = map(int, input().split())
    d, dx, dy = t - p, abs(x - sx), abs(y - sy)
    if (dx + dy) > d or (dx + dy - d) % 2 == 1:
        print("No")
        exit()
    p, sx, sy = t, x, y
else:
    print("Yes")
n = int(input())
l = [list(map(int, input().split())) for _ in range(n)]
ans = True
for i in l:
    t, x, y = i[0], i[1], i[2]
    if x+y > t or (x+y)%2 != t%2:
        ans = False
 
print("Yes") if ans else print("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):
	d = abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i])
	dt = t[i + 1] - t[i]
	if dt < d or dt % 2 != d % 2:
		print("No")
		sys.exit()
	
print("Yes")
N = int(input())
T = []
X = []
Y = []
for _ in range(N):
    t, x, y = map(int, input().split())
    T.append(t)
    X.append(x)
    Y.append(y)
flag = 0
if T[0]-abs(X[0])-abs(Y[0]) < 0 or (T[0]-abs(X[0])-abs(Y[0]))%2 != 0:
    flag = 1
for i in range(N-1):
    if T[i+1]-T[i]-abs(X[i+1]-X[i])-abs(Y[i+1]-Y[i]) < 0 or (T[i+1]-T[i]-abs(X[i+1]-X[i])-abs(Y[i+1]-Y[i]))%2 != 0:
        flag = 1
print("Yes" if flag == 0 else "No")
n = int(input())
lst = [(0,0,0)]
for i in range(n):
    t,x,y = map(int, input().split())
    lst.append((t,x,y))

for i in range(n):
    T,X,Y = lst[i+1][0]-lst[i][0],abs(lst[i][1]-lst[i+1][1]),abs(lst[i][2]-lst[i+1][2])
    if X+Y>T or (X+Y-T)%2!=0:
        print("No")
        exit()

print("Yes")
def move_time(x1,y1,x2,y2):
    return abs(x1-x2)+abs(y1-y2)

n = int(input())
t1 = 0
x1 = 0
y1 = 0
isYes = True
for i in range(n):
    t2,x2,y2 = map(int,input().split())
    tm = move_time(x1,y1,x2,y2)
    #print(tm,t2,x2,y2)
    if tm>(t2-t1):
        isYes = False
    elif ((t2-t1)-tm)%2==1:
        isYes = False
    t1 = t2
    x1 = x2
    y1 = y2

if isYes:
    print('Yes')
else:
    print('No')
n = int(input())
ans = True
for i in range(n):
    t,x,y = map(int,input().split())
    if (x+y)%2 != t%2:
        ans = False
    if x+y>t:
        ans = False
 
if ans:
    print("Yes")
else:
    print("No")
# C - Traveling
# https://atcoder.jp/contests/abc086/tasks/arc089_a

# dt = ti+1 −ti
# dist = abs(xi+1 − xi)+abs(yi+1 − yi)

# キーポイント: パリティ
# x + y は毎秒ごとに必ず偶奇が入れ替わる。

n = int(input())

T = 0
X = 0
Y = 0

cnt = 0

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

    if abs(x-X) + abs(y-Y) <= (t-T) and (x+y)%2 == t%2:
        cnt += 1
    T,X,Y = t,x,y
print("Yes" if cnt == n else "No")
n=int(input())
s=v=w=0
for _ in range(n):
  t,x,y=map(int,input().split())
  dt,dx,dy=t-s,x-v,y-w
  if (dt+dx+dy)%2>0 or dt<abs(dx)+abs(dy): print('No'); break
  s,v,w=t,x,y
else: print('Yes')
N = int(input())
Sorted = [list(map(int, input().split())) for _ in range(N)]
Sorted.insert(0, [0, 0, 0])

for i in range(N):
  d = abs(Sorted[i+1][1] - Sorted[i][1]) + abs(Sorted[i+1][2] - Sorted[i][2])
  t = Sorted[i+1][0] - Sorted[i][0]
  if  d > t or d % 2 != t % 2:
    print("No")
    break
else:
  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 = abs(new_x - old_x) + abs(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)
import sys

input = sys.stdin.readline

def main():
    ans = 'Yes'
    n = int(input())
    now = [0,0]
    pt = 0
    for i in range(n):
        t, x, y = map(int, input().split())
        d = abs((x - now[0]) + (y - now[1]))
        if d > abs(t - pt) or (t - pt)%2 != d%2:
            ans = "No"
            break
        now = [x, y]
        pt = t
    print(ans)

if __name__ == '__main__':
    main()
N = int(input())
T,X,Y =0,0,0
count = 0
for i in range(N):
    t,x,y = map(int,input().split())
    if abs(t-T) >= abs((x+y)-(X+Y)) and t%2==(x+y)%2:
        count+=1
T,X,Y=t,x,y
print('Yes' if count==N else 'No' )
N = int(input())
T = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(N)]
normal = True
def judge(a, b):
  m = b[0]-a[0]-abs(b[1]-a[1])-abs(b[2]-a[2])
  if m>=0 and m%2==0:
    return True
  else:
    return False
for i in range(N):
  if judge(T[i], T[i+1]):
    pass
  else:
    normal = False
    break
print("Yes" if normal else "No")
N = int(input())
travels = [[0, 0, 0]]
travels += [list(map(int, input().split())) for _ in range(N)]
flag = True
for i in range(N):
    cnt = 0
    cnt += abs(travels[i+1][1] - travels[i][1])
    cnt += abs(travels[i+1][2] - travels[i][2])
    time = travels[i+1][0] - travels[i][0]
    if time < cnt or (time-cnt) % 2 == 1:
        flag = False
        break
print('Yes' if flag else 'No')
N = int(input())
x = 0
y = 0
t = 0
for _ in range(N):
    ti, xi, yi = map(int, input().split())
    dist = abs(x-xi) + abs(y-yi)
    flag = False
    if dist % 2 == 0 and not t % 2 == ti % 2:
        flag = True
    elif not dist % 2 == 0 and t % 2 == ti % 2:
        flag = True
    if dist > ti - t or flag:
        print('No')
        exit()
    x = xi
    y = yi
    t = ti

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

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

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


ans = True
move=(x[0]+y[0])
time = t[0] - 0
if move > time:ans = False
if (time - move)%2 ==1:ans = False

for i in range(1,n):
    move =x[i] + y[i] - x[i-1] - y[i-1]
    time =t[i] - t[i-1]
    if move > time:ans = False
    if (time - move)%2 ==1:ans = False

if ans:
    print("Yes")
else:
    print("No")
n = int(input())
t = 0
x = 0
y = 0
flag = True
for i in range(n):
    ti, xi, yi = map(int, input().split())
    if ti % 2 != (xi + yi) % 2:
        flag = False
    elif abs(xi - x) + abs(yi - y) > ti - t:
        flag = False
    t, x, y = ti, xi, yi
if flag:
    print('Yes')
else:
    print('No')
N = int(input())
ans = "Yes"
i = 0
while i < N:
    t,x,y = [int(num) for num in input().split()]
    if x+y <= t and (t-x-y)%2 == 0:
        i += 1
    else:
        ans = "No"
        break
print(ans)
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 time - kyori >= 0:
        t0, x0, y0 = t, x, y
    else:
        print('No')
        exit(0)
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())
curt, curx, cury = 0, 0, 0
ans = 'Yes'
for _ in range(n):
   t, x, y = map(int, input().split())
   d = abs(x - curx) + abs(y - cury)
   if d > (t - curt) or (t - curt) % 2 != d % 2:
      ans = 'No'
      break
   curt, curx, cury = t, x, y

print(ans)
n = input()

t_now = 0
x_now = 0
y_now = 0
can_travel = True
for i in range(int(n)):
  next_value = list(map(int,input().split()))
  dt = next_value[0]-t_now
  dist = abs(next_value[1]-x_now)+abs(next_value[2]-y_now)
  if dt < dist:
    can_travel = False
    break
  elif dt%2 != dist%2:
    can_travel = False
    break

if can_travel:
  print("Yes")
else:
  print("No")
N, *T = map(int, open(0).read().split())
d_t, d_x, d_y = 0, 0, 0
for t, x, y in zip(T[::3], T[1::3], T[2::3]):
    dist = abs(d_x - x) + abs(d_y - y)
    if t - d_t - dist < 0 or (t - d_t - dist) % 2:
        print("No")
        break
    d_t, d_x, d_y = t, x, y
else:
    print("Yes")
N = int(input())
ans = True
for _ in range(N):
  t, x, y = map(int, input().split())
  if t < x + y:
    ans = False
  if t % 2 != (x + y) % 2:
    ans = False
if ans:
  print('Yes')
else:
  print('No')
n = int(input())
tp, xp, yp = 0, 0, 0
for _ in range(n):
    t, x, y = map(int, input().split())
    td = t - tp
    xd = x - xp
    yd = y - yp
    if td < abs(xd) + abs(yd) or (td - abs(xd) - abs(yd)) % 2 == 1:
        print('No')
        break
    tp = t
    xp = x
    yp = y
else:
    print('Yes')
# vim: fileencoding=utf-8


def main():
    n = int(input())
    t, x, y = 0, 0, 0
    for i in range(n):
        a, b, c = map(int, input().split())
        d = a - t
        m = abs(x - b) + abs(y - c)
        if d - m < 0 or (d - m) % 2 == 1:
            print("No")
            return
        t, x, y = a, b, c
    print("Yes")


if __name__ == "__main__":
    main()
n = int(input())
t=0
x=0
y=0
ans ="Yes"
for i in range(n):
  tt,xx,yy = map(int,input().split())
  dif = abs(x-xx)
  dif +=abs(y-yy)
  if dif>(tt-t) or dif%2 !=(tt-t)%2:
    ans = "No"
    break;
  t=tt
  x=xx
  y=yy
print(ans)
n = int(input())
txy = []
for i in range(n):
    txy.append(list(map(int, input().split())))

flag = True
px, py = 0, 0
for i in range(n):
    t, x, y = txy[i]
    d = abs(x-px) + abs(y-py)
    if d <= t:
        if d % 2 != t % 2:
            flag = False
    else:
        flag = False

if flag:
    print("Yes")
else:
    print("No")
n = int(input())

ti,xi,yi = 0,0,0
found = True
for _ in range(n):
    t, x, y = map(int, input().split())
    root = abs(x-xi)+abs(y-yi)
    if root > (t-ti) or (t-ti-root)&1:
        found = False
    ti,xi,yi = t,x,y  
    
print("Yes" if found else "No")
N = int(input())

bt, bx, by = 0, 0, 0

for _ 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:
        print('No')
        break
    bt, bx, by = t, x, y
else:
    print('Yes')
from sys import exit

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

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

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

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

ans = 'Yes'

for j in range(N):
    if t[j] % 2 != (x[j] + y[j]) % 2 or t[j] < abs(x[j]) + abs(y[j]):
        ans = 'No'
        break

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

judg = 0    

for i in range(N):
    if x[i]+y[i]<=t[i]:
        if t[i]%2==0 and (x[i]+y[i])%2==0:
            judg += 1
        elif t[i]%2!=0 and (x[i]+y[i])%2!=0:
            judg += 1

if judg == N:
    print('Yes')
else:
    print('No')
n=int(input())
s = 0
a = 0
b = 0
for i in range(n):
    t,x,y=map(int,input().split())
    if t-s - abs(x-a) - abs(y-b)>=0 and (t-s - abs(x-a) - abs(y-b)) %2 == 0:
        s = t
        a = x
        b = y
    else:
        print('No')
        exit()
print('Yes')
n = int(input())

prev_t, prev_x, prev_y = 0, 0, 0
for _ in range(n):
    t, x, y = map(int, input().split())
    if (abs(x - prev_x) + abs(y - prev_y) <= t - prev_t and
        (abs(x - prev_x) + abs(y - prev_y)) % 2 == (t - prev_t) % 2):
        prev_t, prev_x, prev_y = t, x, y
        continue
    else:
        print('No')
        break
else:
    print('Yes')
N = int(input())
t,x,y = 0,0,0
badtrip=False
for i in range(N):
    ti, xi, yi = list(map(int, input().split()))
    absx = abs(x-xi)
    absy = abs(y-yi) 
    if (absx+absy)%2 == (ti-t)%2 and (ti-t)>=(absx+absy):
        t=ti
        x=xi
        y=yi
    else:
        badtrip=True
        break

if badtrip:
    print('No')
else:
    print('Yes')
N = int(input())
T, X, Y = 0, 0, 0

can_reach = True
for i in range(N):
  next_T, next_X, next_Y = map(int, input().split())
  
  z = next_T - T - abs(X - next_X) - abs(Y - next_Y)
  if z >= 0 and z % 2 == 0:
    T, X, Y = next_T, next_X, next_Y
  else:
    can_reach = False
    break
    
if can_reach:
  print('Yes')
else:
  print('No')
n = int(input())
t = 0
x = 0
y = 0
for i in range(n):
    nt , nx , ny = map(int,input().split())
    if nt - t >= nx - x + ny -y and ((nt - t) - (nx -x + ny -y)) % 2 == 0:
        t = nt
        x = nx
        y = ny
    else:
        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())

flag=True
for i in range(n):
    time=t[i+1]-t[i]
    dist=abs(x[i+1]-x[i])+abs(y[i+1]-y[i])
    if dist>time:
        flag=False
    if dist%2 != time%2:
        flag=False
if flag == True:
    print('Yes')
else:
    print('No')
N=int(input())
x,y=0,0
time=0
for i in range(N):
  t,a,b=map(int,input().split())
  if abs(x-a)+abs(y-b)>t-time or (abs(x-a)+abs(y-b)-t+time)%2==1:
    print("No")
    exit()
  time=t
  x=a
  y=b
print("Yes")
n=int(input())
a = [0]*(n+1)
a[0] = [0, 0, 0]
for i in range(n):
    a[i+1]=list(map(int,input().split()))

flag = True
for i in range(n):
    if abs(a[i+1][1]-a[i][1])+abs(a[i+1][2]-a[i][2]) > (a[i+1][0]-a[i][0]):
        flag=False
    elif (abs(a[i+1][1]-a[i][1])+abs(a[i+1][2]-a[i][2])-(a[i+1][0]-a[i][0]))%2==1:
        flag=False

if flag:
    print("Yes")
else:
    print("No")
n = int(input())
prev_t, prev_x, prev_y = 0, 0, 0
for i in range(n):
    t, x, y = list(map(int, input().split()))
    if abs(prev_x - x) + abs(prev_y - y) > abs(prev_t - t) or (
            abs(prev_x - x) + abs(prev_y - y) + abs(prev_t - t)) % 2:
        print('No')
        exit()
    prev_t, prev_x, prev_y = t, x, y
print('Yes')
N = int(input())
T, X, Y = 0, 0, 0
count = 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 and t%2 == (x+y)%2:
    count += 1
  T, X, Y = t, x, y
print('Yes' if count == N else 'No')
n=int(input())
x=0
y=0
t=0
f=0
for i in range(n):
    T,a,b=map(int,input().split())
    if not(abs(a-x)+abs(b-y)<=T-t and (abs(a-x)+abs(b-y)-(T-t))%2==0):
        f=1
    x=a
    y=b
    t=T
print("Yes" if f==0 else "No")
N = int(input())

t_prev=0
x_prev=0
y_prev=0

for i in range(N):
    t_i, x_i, y_i = map(int, input().split()) 

    if (x_i+y_i)> t_i:
        print("No")
        exit()
    elif (x_i+y_i) %2 != t_i%2 :
        print("No")
        exit()
    elif x_i-x_prev > t_i-t_prev or y_i-y_prev>t_i-t_prev:
        print('No')
        exit()

    t_prev=t_i
    x_prev=x_i
    y_prev=y_i

print("Yes")
a = int(input())
for n in list(range(a+1)):
  if n == 1:
    b,c,d = map(int, input().split())
    if c + d > b or (c + d - b) % 2 != 0:
      print('No')
      break
  if n >= 2:
    b1 = b
    c1 = c
    d1 = d
    b,c,d = map(int, input().split())
    if abs(c-c1) + abs(d-d1) > b-b1 or (abs(c-c1) + abs(d-d1) - (b-b1)) % 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())
    dist = abs(x - now[0]) + abs(y - now[1])
    if dist <= t and (t - dist) % 2 == 0:
        continue
    print('No')
    quit()
 
print('Yes')
n = int(input())
P = [[0, 0, 0]]
f = True
for i in range(n):
    t, x, y = map(int, input().split())
    s = abs(x - P[i][1]) + abs(y-P[i][2])
    if s > t-P[i][0] or (t-P[i][0] - s)%2 == 1:
        f = False
    P.append([t, x, y])
if f: print("Yes")
else: print("No")
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()
    now_x = x
    now_y = y
    pre_t = t

print('Yes')
n = int(input())
s = [0, 0, 0]
ans = 'Yes'
for i in range(n):
  l = list(map(int, input().split()))
  diff_t = l[0] - s[0]
  diff_x = abs(s[1] - l[1])
  diff_y = abs(s[2] - l[2])
  s = [l[0], l[1], l[2]]
  if diff_x + diff_y > diff_t or (diff_t - diff_x - diff_y) % 2 != 0:
    ans = 'No'
print(ans)
N = int(input())

time = 0
visited = [0, 0]
result = []

for i in range(N):
    t, *xy = map(int, input().split())
    diff_time = t - time
    diff_dist = sum([abs(xy[i] - visited[i]) for i in range(2)])
    if (diff_dist <= diff_time) & (((diff_time - diff_dist) % 2)==0):
        result.append(True)
    else:
        result.append(False)
    time = t
    visited = xy

print("Yes") if all(result) else print("No")
n=int(input())
dt,dx,dy=0,0,0
for i in range(n):
  t,x,y=map(int,input().split())
  if abs(x-dx) + abs(y-dy) > t-dt or (x+y)%2!=t%2:
    print("No")
    break
  dt,dx,dy=t,x,y
else:
  print("Yes")
N = int(input())
txn = []
for i in range(N):
  txn.append([int(i) for i in input().split()])

ima = [0,0,0]
for i in range(N):
  dist = abs(ima[1] - txn[i][1]) + abs(ima[2] - txn[i][2])

  if dist > (txn[i][0] - ima[0]) :
    print("No")
    exit()
  
  if dist%2 != (txn[i][0] - ima[0])%2 :
    print("No")
    exit()
  
  ima = txn[i]

print("Yes")
N = int(input())
li = []
pre_t = 0
pre_x = 0
pre_y = 0
ans = "Yes"
for _ in range(N):
    t, x, y = map(int, input().split())
    dist = abs(x - pre_x) + abs(y - pre_y)
    d_t = abs(t - pre_t)
    if dist > d_t or (dist - d_t) % 2 == 1:
        ans = "No"

    pre_t, pre_x, pre_y = t, x, y

print(ans)