CodeEff/ECCO huggingface dataset:
# Original solution
N = int(eval(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] = list(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'))

# Optimized solution
n = int(eval(input()))
for i in range(n):
    t,x,y=list(map(int,input().split()))
    if (x + y) > t or (x + y + t) % 2:
        print("No")
        exit()
print("Yes")
# Original solution
n = int(eval(input()))
x = 0
y = 0
time = 0
for i in range(n):
    m = list(map(int,input().split()))
    if (m[0]-time)>=abs(m[1]-x)+abs(m[2]-y):
        if ((m[0]-time) -(abs(m[1]-x) + abs(m[2]-y)))%2 ==0:
            x = m[1]
            y = m[2]
            time = m[0]
            if i == n-1:
                print("Yes")
        else:
            print("No")
            break
    else:
        print("No")
        break

# Optimized solution
a = int(eval(input()))
x = 0
y = 0
time = 0
for i in range(a):
    aa,b,c = list(map(int,input().split()))
    if (abs(b-x) + abs(c-y)) %2 == (aa - time)%2 and abs(b-x) + abs(c-y) <= aa - time:
        x = b
        y = c
        time = aa
    else:
        print("No")
        break
    if i == a-1:
        print("Yes")
# Original solution
n,*l=list(map(int,open(0).read().split()));print(("YNeos"[any((i+j+k)%2+(i<j+k)for i,j,k in zip(*[iter([abs(i-j)for i,j in zip([0,0,0]+l,l)])]*3))::2]))

# Optimized solution
_,*l=list(map(int,open(0).read().split()));print(("YNeos"[any((t+x+y)%2+(t<x+y)for t,x,y in zip(*[iter(l)]*3))::2]))
# Original solution
N = int(eval(input()))
All = [list(map(int, input().split())) for _ in range(N)]
t = [row[0] for row in All]
x = [row[1] for row in All]
y = [row[2] for row in All]
pre_x = 0
pre_y = 0
pre_t = 0

can = True
for n in range(N):
    can2 = False
    T  = abs(t[n] - pre_t)
    dx = abs(x[n] - pre_x)
    dy = abs(y[n] - pre_y)
    # print(T,dx,dy)
    if dx + dy == 0 and T % 2 == 0:
        can2 = True
        # print("成功")
    elif dx + dy == 0 and T % 2 != 0:
        can2 = False
        # print("失敗")
        break

    if (T % (dx + dy)) == 0:
        can2 = True
        # print("成功")

    if can2 == False:
        can = False
        # print("失敗")
        break

    pre_t = t[n]
    pre_x = x[n]
    pre_y = y[n]

if can == True:
    print("Yes")
else:
    print("No")


# Optimized solution
N = int(eval(input()))
All = [list(map(int, input().split())) for _ in range(N)]
pre_x = 0
pre_y = 0
pre_t = 0

can = True
for n in range(N):
    can2 = False
    T = All[n][0] - pre_t
    d = abs(All[n][1] - pre_x) + abs(All[n][2] - pre_y)
    # print(T, d)
    if d <= T and T % 2 ==  d % 2:
        can2 = True

    if can2 == False:
        can = False
        break

    pre_t = All[n][0]
    pre_x = All[n][1]
    pre_y = All[n][2]

if can == True:
    print("Yes")
else:
    print("No")
# Original solution
N=int(eval(input()))
T=[list(map(int,input().split())) for i in range(N)]
for i in range(N):
    t=T[i][0]
    j=T[i][1]+T[i][2]
    if t<j or (t+j)%2:
        print("No")
        exit()
print("Yes")

# Optimized solution
N=int(eval(input()))
for i in range(N):
    t,x,y=list(map(int, input().split()))
    j=x+y
    if t<j or (t+j)%2:
        print("No")
        exit()
print("Yes")
# Original solution

#入力受け取り
n = int(eval(input()))
tourList = []
for i in range(n):
    array = list(map(int, input().strip().split()))
    tourList.append(array)

#DebugPrint

currentTime = 0
currentX = 0
currentY = 0

loop=0

for i in range(len(tourList)) :
    Time = tourList[i][0]
    X = tourList[i][1]
    Y = tourList[i][2]

    Time = Time - currentTime
    X = X - currentX
    Y = Y - currentY
    flag=False
    Z=0 #往復調整用    
    while (X+Y+Z) <= Time :
        if X+Y+Z == Time:
            flag=True
            break
        else:
            Z+=2
    
    #継続判定
    if flag == False:
        print("No")
        exit()
    
    currentTime = Time
    currentX = X
    currentY = Y

print("Yes")

    #最初の点がまず実現可能か


# Optimized solution

#入力受け取り
n = int(eval(input()))
tourList = []
for i in range(n):
    array = list(map(int, input().strip().split()))
    tourList.append(array)

#DebugPrint
currentTime = 0
currentX = 0
currentY = 0

for i in range(len(tourList)) :
    Time = tourList[i][0]
    X = tourList[i][1]
    Y = tourList[i][2]

    Time = Time - currentTime
    X = X - currentX
    Y = Y - currentY
    flag=False

    NUM = abs(X)+abs(Y)
    if( (Time-NUM)%2==0 and NUM <= Time):
        flag=True

    # while (X+Y+Z) <= Time :
    #     if X+Y+Z == Time:
    #         flag=True
    #         break
    #     else:
    #         Z+=2
    
    #継続判定
    if flag == False:
        print("No")
        exit()
    
    currentTime = Time
    currentX = X
    currentY = Y

print("Yes")

    #最初の点がまず実現可能か
# Original solution
import unittest


def is_ある時刻での判定(t, d):
    # 時刻t >= d でないと実現不可能
    if t < d:
        return True

    # 偶奇が一致しないと実現不可能
    if not (t % 2 == d % 2):
        return True

    return False


def can_not_realize(N, t_list, x_list, y_list) -> bool:
    # 各時刻ごとの判定
    for t, x, y in zip(t_list, x_list, y_list):
        d = x + y

        if is_ある時刻での判定(t, d):
            return True

    # t_n と t_n+1 間 での移動判定
    for i in range(N):
        if i + 1 >= N:
            break

        t = t_list[i + 1] - t_list[i]
        diff_x = abs(x_list[i + 1] - x_list[i])
        diff_y = abs(y_list[i + 1] - y_list[i])

        d = diff_x + diff_y

        if is_ある時刻での判定(t, d):
            return True

    return False


def actual(N, t_list, x_list, y_list):
    if can_not_realize(N, t_list, x_list, y_list):
        return 'No'

    return 'Yes'

N = int(eval(input()))

t_list, x_list, y_list = [], [], []
for _ in range(N):
  t, x, y = list(map(int, input().split()))
  t_list.append(t)
  x_list.append(x)
  y_list.append(y)
  
print((actual(N, t_list, x_list, y_list)))
  

# Optimized solution
def can_not_realize(N, t_list, x_list, y_list) -> bool:
    # t_n と t_n+1 間 での移動判定
    for i in range(N):
        diff_t = t_list[i + 1] - t_list[i]
        diff_x = abs(x_list[i + 1] - x_list[i])
        diff_y = abs(y_list[i + 1] - y_list[i])

        sum_of_moving = diff_x + diff_y

        # 時刻t >= sum_of_moving でないと実現不可能
        if diff_t < sum_of_moving:
            return True

        # 偶奇が一致しないと実現不可能
        if not (diff_t % 2 == sum_of_moving % 2):
            return True

    return False

def actual(N, t_list, x_list, y_list):
    # t=0 で (0,0) を追加する
    t_list = [0] + t_list
    x_list = [0] + x_list
    y_list = [0] + y_list

    if can_not_realize(N, t_list, x_list, y_list):
        return 'No'

    return 'Yes'

N = int(eval(input()))

t_list, x_list, y_list = [], [], []

for _ in range(N):
  t, x, y = list(map(int, input().split()))
  t_list.append(t)
  x_list.append(x)
  y_list.append(y)
  
print((actual(N, t_list, x_list, y_list)))
# Original solution
n=int(eval(input()))
nowx, nowy, nowt = 0, 0, 0
for i in range(n):
	t,x,y = list(map(int,input().split()))
	k = t-nowt-abs(nowx-x)-abs(nowy-y)
	if k >= 0 and k % 2 == 0:
		nowx, nowy, nowt = x, y, t
	else:
		print("No")
		exit()
print("Yes")


# Optimized solution
n = int(eval(input()))
t = 0
x = 0
y = 0
for _ in range(n):
	nt, nx, ny = list(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")
# Original solution
def is_reachable(dept, dest):
    distance = abs(dest[1] - dept[1]) + abs(dest[2] - dept[2])
    time = dest[0] - dept[0]
    if (time - distance >= 0) and ((time - distance) % 2 == 0):
        return True
    else:
        return False


N = int(eval(input()))
itin = [(0, 0, 0)]
itin_append = itin.append
for n in range(N):
    itin_append(tuple(map(int, input().split())))

for n in range(N):
    if is_reachable(itin[n], itin[n + 1]):
        continue
    else:
        print('No')
        break
else:
    print('Yes')


# Optimized solution
import sys


N = int(eval(input()))
t, x, y = 0, 0, 0
ans = 'No'
for s in sys.stdin.readlines():
    nt, nx, ny = list(map(int, s.split()))
    T = nt - t
    D = abs(nx - x) + abs(ny - y)
    if T < D or T % 2 != D % 2:
        break
    t, x, y = nt, nx, ny
else:
    ans = 'Yes'

print(ans)
# Original solution
n = int(eval(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 = list(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

print(("Yes" if reachable == True else "No"))

# Optimized solution
n = int(eval(input()))
t = [0]
x = [0]
y = [0]
for _ in range(n):
    t_tmp, x_tmp, y_tmp = list(map(int, input().split(" ")))
    t.append(t_tmp)
    x.append(x_tmp)
    y.append(y_tmp)

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

print(("Yes" if reachable == True else "No"))
# Original solution
# coding: utf-8
import math
n = int(eval(input()))
t = 0
x = 0
y = 0
txy = []
for i in range(n):
    ti, xi, yi = list(map(int, input().split()))
    txy.append((ti, xi, yi))

for ti, xi, yi in txy:
    if abs(xi - x) + abs(yi - y) > abs(ti - t):
        print("No")
        exit()
    elif (abs(xi - x) + abs(yi - y) - abs(ti - t)) % 2 != 0:
        print("No")
        exit()
    else:
        t = ti
        x = xi
        y = yi
print("Yes")


# Optimized solution
# coding: utf-8
import math
n = int(eval(input()))
t = 0
x = 0
y = 0
# txy = []
# for i in range(n):
#     ti, xi, yi = list(map(int, input().split()))
#     txy.append((ti, xi, yi))
for i in range(n):
    ti, xi, yi = list(map(int, input().split()))
    if abs(xi - x) + abs(yi - y) > abs(ti - t):
        print("No")
        exit()
    elif (abs(xi - x) + abs(yi - y) - abs(ti - t)) % 2 != 0:
        print("No")
        exit()
    else:
        t = ti
        x = xi
        y = yi
print("Yes")
# Original solution
N = int(eval(input()))
TXY = [tuple(map(int,input().split())) for i in range(N)]

ct = cx = cy = 0
for t,x,y in TXY:
    dt = t-ct
    d = abs(cx-x)+abs(cy-y)
    if dt < d or dt%2 != d%2:
        print('No')
        exit()
    ct,cx,cy = t,x,y
print('Yes')

# Optimized solution
N = int(eval(input()))
TXY = [tuple(map(int,input().split())) for i in range(N)]
ct = cx = cy = 0
for t,x,y in TXY:
    d = abs(cx-x) + abs(cy-y)
    if d > t-ct or d%2 != (t-ct)%2:
        print('No')
        exit()
    ct,cx,cy = t,x,y
print('Yes')
# Original solution
def validation(l1, l2):
  dif_t = abs(l2[0] - l1[0])
  dif_x = abs(l2[1] - l1[1])
  dif_y = l2[2] - l1[2]

  if dif_x + dif_y > dif_t:
    return False
  elif dif_t % 2 == 0:
    if (dif_x + dif_y) % 2 != 0:
      return False
    else:
      return True
  elif dif_t % 2 != 0:
    if (dif_x + dif_y) % 2 == 0:
      return False
    return True
  else:
    return True

n = int(eval(input()))
l1 = [0,0,0]
ans = "Yes"
for _ in range(n):
  l2 = list(map(int, input().split()))
  if  validation(l1, l2):
    l1 = l2
  else:
    ans = "No"

print(ans)

# Optimized solution
n = int(eval(input()))
current_time = 0
current_pos = 0
ans = True
for _ in range(n):
    t, x, y = list(map(int, input().split()))
    time_dif = t - current_time # 3
    pos_dif = (x+y) - current_pos # 3
    if time_dif % 2 == 1 and pos_dif % 2 == 1 and pos_dif <= time_dif:
        current_time += time_dif
        current_pos += pos_dif
    elif time_dif % 2 == 0 and pos_dif % 2 == 0 and pos_dif <= time_dif:
        current_time += time_dif
        current_pos += pos_dif
    else:
        ans = False

if ans:
    print("Yes")
else:
    print("No")
# Original solution
from sys import stdin

input = stdin.readline

N = int(eval(input()))

txy = [[int(j) for j in input().split()] for i in range(N)]


def main():
    pt = 0
    px = 0
    py = 0

    flg = False

    for t, x, y in txy:
        # 到達 あるいは 通過
        if abs(x - px) + abs(y - py) <= t - pt:
            # 距離と時間の偶奇が一致しない 戻れない
            if (abs(x - px) + abs(y - py)) % 2 != (t - pt) % 2:
                break
            else:
                pt = t
                px = x
                py = y
        # 到達しない
        else:
            break
    else:
        # break しなかった 完走
        flg = True

    print(("Yes" if flg else "No"))
    return


main()


# Optimized solution
from sys import stdin

input = stdin.readline

N = int(eval(input()))

txy = [[int(j) for j in input().split()] for i in range(N)]


def main():
    pt = 0
    px = 0
    py = 0

    flg = False

    for t, x, y in txy:
        d = abs(x - px) + abs(y - py)
        dt = t - pt
        # 到達 あるいは 通過
        if d <= dt:
            # 距離と時間の偶奇が一致しない 戻れない
            if d % 2 != dt % 2:
                break
            else:
                pt = t
                px = x
                py = y
        # 到達しない
        else:
            break
    else:
        # break しなかった 完走
        flg = True

    print(("Yes" if flg else "No"))
    return


main()
# Original solution
from sys import stdin

input = stdin.readline

N = int(eval(input()))

txy = [[int(j) for j in input().split()] for i in range(N)]


def main():
    pt = 0
    px = 0
    py = 0

    flg = False

    for t, x, y in txy:
        dt = t - pt - abs(x - px) - abs(y - py)
        # 余った時間が奇数 戻れない
        if dt < 0 or dt % 2 == 1:
            break

        pt = t
        px = x
        py = y
    else:
        # break しなかった 完走
        flg = True

    print(("Yes" if flg else "No"))
    return


main()


# Optimized solution
from sys import stdin

input = stdin.readline
lines = stdin.readlines

N = int(eval(input()))

txy = ((list(map(int, line.split()))) for line in lines())


def main():
    pt = 0
    px = 0
    py = 0

    flg = False

    for t, x, y in txy:
        dt = t - pt - abs(x - px) - abs(y - py)
        # 余った時間が奇数 戻れない
        if dt < 0 or dt % 2 == 1:
            break

        pt = t
        px = x
        py = y
    else:
        # break しなかった 完走
        flg = True

    print(("Yes" if flg else "No"))
    return


main()
# Original solution
N = int(eval(input()))
t,x,y = 0,0,0
for i in range(N):
    T,X,Y = list(map(int,input().split()))
    d = abs(x-X)+abs(y-Y)
    if (T-t)-d >= 0 and ((T-t)-d)%2 == 0:
        t,x,y = T,X,Y
        continue
    else:
        print('No')
        exit()
print('Yes')

# Optimized solution
import sys
input = sys.stdin.readline
N = int(eval(input()))
t,x,y = 0,0,0
for i in range(N):
    T,X,Y = list(map(int,input().split()))
    d = abs(x-X)+abs(y-Y)
    if (T-t)-d >= 0 and ((T-t)-d)%2 == 0:
        t,x,y = T,X,Y
        continue
    else:
        print('No')
        exit()
print('Yes')
# Original solution
n = int(eval(input())) 
TXY = [[0,0,0]] + [list(map(int, input().split())) for _ in range(n)]
diff = [[t2 - t1, abs(x2 - x1), abs(y2 - y1)] for (t1, x1, y1), (t2, x2, y2) in zip(TXY, TXY[1:])]
for t, x, y in diff:
  if x + y > t or (t - (x + y)) % 2 == 1:
    print("No")
    exit()
print("Yes")

# Optimized solution
n = int(eval(input())) 
TXY = [[0,0,0]] + [list(map(int, input().split())) for _ in range(n)]
diff = [[t2 - t1, abs(x2 - x1), abs(y2 - y1)] for (t1, x1, y1), (t2, x2, y2) in zip(TXY, TXY[1:])]
if all([x + y <= t and (t - (x + y)) % 2 == 0 for t, x, y in diff]):
  print("Yes")
else:
  print("No")
# Original solution

r = 1
t = 0
m = 0
N = int(eval(input()))
txy = []

for i in range(N):
    txy.append([int(x) for x in input().split()])


for i in txy:
    t = i[0] - t
    m = abs((i[1] + i[2]) - m)
    
    if i[0] % 2 == 0:
        if (i[1] + i[2]) % 2 != 0:
            print("No")
            break
        elif t < m:
            print("No")
            break
            
    else:
        if (i[1] + i[2]) % 2 != 1:
            print("No")
            break
        elif t < m:
            print("No")
            break
    
   
    if r == N and t >= m:
        print("Yes")
        
    r += 1
    
    
    
            

# Optimized solution

r = 1
t = 0
m = 0
N = int(eval(input()))
txy = []

for i in range(N):
    txy.append([int(x) for x in input().split()])


for i in txy:
    t = i[0] - t
    m = abs((i[1] + i[2]) - m)
    
    if t < m:
        print("No")
        break
    elif (t - m) % 2 != 0:
        print("No")
        break
    
    
    
    if r == N and t >= m:
        print("Yes")
        
    r += 1
# Original solution
import sys

default_x = 0
default_y = 0

n = int(eval(input()))

a = []

#標準入力をN分読み込み
for i in range(n):
        a.append(list(map(int,input().split())))

times = 0
for i in range(n):
    for j in range(a[i][0]+times):
        if default_x < a[i][1]:
            default_x += 1
        elif default_x > a[i][1]:
            default_x -= 1

        elif default_y < a[i][2]:
            default_y += 1
        elif default_y > a[i][2]:
            default_y -= 1
        else:
            default_y -= 1

    if default_x != a[i][1] or default_y != a[i][2]:
        print('No')
        sys.exit()

    times  = a[i][0]

print('Yes')

# Optimized solution
n = int(eval(input()))

travel = list()
#start point
travel.append((0,0,0))

for i in range(n):
  travel.append(tuple(map(int,input().split())))


for j in range(n):
  dist = abs(travel[j][0]-travel[j+1][0])

  dd = abs(travel[j][1]-travel[j+1][1])+abs(travel[j][2]-travel[j+1][2])
  
#fail
  if dist < dd or (dd%2 != dist%2):
    print("No")
    exit(0) 

print("Yes")
# Original solution
import sys

N = int(sys.stdin.readline())
TXY = [
    tuple(map(int, sys.stdin.readline().split())) for _ in range(N)
]

def check(st, sx, sy, et, ex, ey):
    if abs(sx - ex) + abs(sy - ey) > et - st:
        return False
    points = [(sx, sy)]
    for _ in range(et - st):
        new_points = set()
        for px, py in points:
            new_points.add((px + 1, py))
            new_points.add((px - 1, py))
            new_points.add((px, py + 1))
            new_points.add((px, py - 1))
        points = list(new_points)
    if (ex, ey) in points:
        return True
    return False


def main():
    TXY.insert(0, (0, 0, 0))
    for i in range(len(TXY) - 1):
        args = TXY[i] + TXY[i + 1]
        if not check(*args):
            print('No')
            return
    print('Yes')

main()

# Optimized solution
import sys

N = int(sys.stdin.readline())
TXY = [
    tuple(map(int, sys.stdin.readline().split())) for _ in range(N)
]

def check(st, sx, sy, et, ex, ey):
    timespan = et - st
    diff = abs(sx - ex) + abs(sy - ey)
    if diff > timespan:
        return False
    if (timespan - diff) % 2 == 0:
        return True
    return False


def main():
    TXY.insert(0, (0, 0, 0))
    for i in range(len(TXY) - 1):
        args = TXY[i] + TXY[i + 1]
        if not check(*args):
            print('No')
            return
    print('Yes')

main()
# Original solution
n = int(eval(input()))
a0 = [0,0,0]
ans = "Yes"
for i in range(n):
    ai = list(map(int,input().split()))
    t = ai[0] - a0[0]
    d = abs(ai[1] - a0[1])+ abs(ai[2] - a0[2])
    if t < d or t%2 != d%2:
        ans = "No"
    a0 = ai
print(ans)

# Optimized solution
n = int(eval(input()))
t0,x0,y0 = 0,0,0
for i in range(n):
    t,x,y = list(map(int, input().split()))
    if abs(t0-t)%2 != (abs(x0-x)+abs(y0-y))%2 or (abs(x0-x)+abs(y0-y)) > abs(t0-t):
        print("No")
        exit()
    t0,x0,y0, = t,x,y
else:
    print("Yes")
# Original solution
N=int(eval(input()))
txy=[list(map(int,input().split())) for i in range(N)]
ans=0
for i in range(N):
    t,x,y=txy[i][0],txy[i][1],txy[i][2]
    if x+y<=t and t%2==(x+y)%2:ans+=1
print(("Yes" if ans==N else "No"))

# Optimized solution
n = int(eval(input()))

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

for i in range(n):
    t, x, y = txy[i]
    if  x + y > t or (t - x - y) % 2:
        print("No")
        exit()
print("Yes")
# Original solution
def difference(two_lists):
    return [abs(two_lists[1][i] - two_lists[0][i]) for i in range(3)]


n = int(eval(input()))

txy = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(n)]
dtxy = list(map(difference, list(zip(txy, txy[1:]))))

for i in range(n):
    dt, dx, dy = dtxy[i]
    if  dx + dy > dt or (dt - dx - dy) % 2:
        print("No")
        exit()
print("Yes")

# Optimized solution
n = int(eval(input()))

for _ in range(n):
    t, x, y = list(map(int, input().split()))
    if  x + y > t or (t - x - y) % 2:
        print("No")
        exit()
print("Yes")
# Original solution
n = int(eval(input()))
pretime, prex, prey = 0, 0, 0
for i in range(n):
    nowtime, nowx, nowy = list(map(int, input().split()))
    time = nowtime - pretime
    x = abs(nowx - prex)
    y = abs(nowy - prey)
    if x+y > time:
        print("No")
        exit()
    if (x+y) % 2 != time % 2:
        print("No")
        exit()
    pretime = nowtime
    prex, prey = nowx, nowy
else:
    print("Yes")

# Optimized solution
n = int(eval(input()))
for i in range(n):
    t,x,y=list(map(int,input().split()))
    if(not((x+y)<=t and (x+y)%2 == t%2)):
        print("No")
        exit()
print("Yes")
# Original solution
n=int(eval(input()))
t,x,y=[0],[0],[0]
for i in range(n):
    T,X,Y=list(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')

# Optimized solution
n=int(eval(input()))
t,x,y=[],[],[]

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

current=[0,0]
for i in range(n):
    next=[x[i]-current[0],y[i]-current[1]]
    if abs(sum(next))>t[i] or (abs(sum(next))+t[i])%2!=0:
        print('No')
        exit()
print('Yes')
# Original solution
N = int(eval(input()))
D = [input().split() for i in range(N)]

DD = []

for i in range(N):
    DD.append([int(D[i][0]),int(D[i][1]),int(D[i][2])])

diff = [[0,0,0],[DD[0][0]-0,DD[0][1]-0,DD[0][2]-0]]

for i in range(N-1):
    diff.append([DD[i+1][0]-DD[i][0],DD[i+1][1]-DD[i][1],DD[i+1][2]-DD[i][2]])

def judge(t, x, y):
    if t < (abs(x) + abs(y)):
        return 1
    else:
        if (t % 2) == ((abs(x) + abs(y)) % 2):
            return 0
        else:
            return 1

count = 0
for i in range(N+1):
    count += judge(diff[i][0], diff[i][1], diff[i][2])

if count >= 1:
    print("No")
else:
    print("Yes")

# Optimized solution
N = int(eval(input()))
for _ in range(N):
    t, x, y = list(map(int, input().split()))
    if x + y > t or (t + x + y)%2 != 0:
        print("No")
        quit()
print("Yes")
# Original solution
N=int(eval(input()))

clear_flag=0
tmp=0
tmp_x=0
tmp_y=0
for i in range(N):
  txy=list(map(int,input().split()))
  x=0
  y=0
  next_flag=0
  for x_plus in range(txy[0]-tmp+1):
    if next_flag==1:
      break
    for x_minus in range(txy[0]-tmp+1-x_plus):
      if next_flag==1:
        break
      for y_plus in range(txy[0]-tmp+1-x_plus-x_minus):
        y_minus=txy[0]-tmp-x_plus-x_minus-y_plus
        x=x_plus-x_minus+tmp_x
        y=y_plus-y_minus+tmp_y
        if x==txy[1] and y==txy[2]:
          next_flag=1
          clear_flag+=1
          tmp=txy[0]
          tmp_x=txy[1]
          tmp_y=txy[2]
          break
            
if clear_flag==N:
  print("Yes")
else:
  print("No")

# Optimized solution
N=int(eval(input()))

clear_flag=0
for i in range(N):
  txy=list(map(int,input().split()))
  if txy[0]>=(txy[1]+txy[2]) and (txy[0]+txy[1]+txy[2])%2==0:
    clear_flag+=1
  else:
    break
    
if clear_flag==N:
  print("Yes")
else:
  print("No")