import numpy as np



n = int(eval(input()))

input_X = [[int(i) for i in input().split()] for i in range(n)]

X = np.array(input_X)



pre_t = 0

pre_x = 0

pre_y = 0

for i in range(n):

    x_move = abs(X[i][1] - pre_x)

    y_move = abs(X[i][2] - pre_y)

    xy_sum = x_move + y_move

    spend_time = X[i][0]-pre_t

    if xy_sum%2 == spend_time%2 and spend_time >= xy_sum:

        pre_t = X[i][0]

        pre_x = X[i][1]

        pre_y = X[i][2]

        if i+1 == n:

            print('Yes')

        else:

            continue

    else:

        print('No')

        break
# C

import copy

n = int(eval(input()))

preX = [0,0,0]

ans = True

for i in range(n):

    curX = list(map(int, input().split()))

    dt = curX[0] - preX[0]

    dx = abs(curX[1] - preX[1])

    dy = abs(curX[2] - preX[2])

    if dt < dx + dy  or (dt % 2) != ((dx + dy) % 2):

        ans = False

    preX = copy.copy(curX)

if ans:

    print('Yes')

else:

    print('No')
import numpy as np

n = int(eval(input()))
input_X = [[int(i) for i in input().split()] for i in range(n)]
X = np.array(input_X)
pre_t = 0
pre_x = 0
pre_y = 0
for i in range(n):
    x_move = abs(X[i][1] - pre_x)
    y_move = abs(X[i][2] - pre_y)
    xy_sum = x_move + y_move
    spend_time = X[i][0] - pre_t
    if xy_sum % 2 == spend_time % 2 and spend_time >= xy_sum:
        pre_t = X[i][0]
        pre_x = X[i][1]
        pre_y = X[i][2]
        if i + 1 == n:
            print("Yes")
        else:
            continue
    else:
        print("No")
        break

# C
import copy

n = int(eval(input()))
preX = [0, 0, 0]
ans = True
for i in range(n):
    curX = list(map(int, input().split()))
    dt = curX[0] - preX[0]
    dx = abs(curX[1] - preX[1])
    dy = abs(curX[2] - preX[2])
    if dt < dx + dy or (dt % 2) != ((dx + dy) % 2):
        ans = False
    preX = copy.copy(curX)
if ans:
    print("Yes")
else:
    print("No")

-import numpy as np +# C +import copy -input_X = [[int(i) for i in input().split()] for i in range(n)] -X = np.array(input_X) -pre_t = 0 -pre_x = 0 -pre_y = 0 +preX = [0, 0, 0] +ans = True -    x_move = abs(X[i][1] - pre_x) -    y_move = abs(X[i][2] - pre_y) -    xy_sum = x_move + y_move -    spend_time = X[i][0] - pre_t -    if xy_sum % 2 == spend_time % 2 and spend_time >= xy_sum: -        pre_t = X[i][0] -        pre_x = X[i][1] -        pre_y = X[i][2] -        if i + 1 == n: -            print("Yes") -        else: -            continue -    else: -        print("No") -        break +    curX = list(map(int, input().split())) +    dt = curX[0] - preX[0] +    dx = abs(curX[1] - preX[1]) +    dy = abs(curX[2] - preX[2]) +    if dt < dx + dy or (dt % 2) != ((dx + dy) % 2): +        ans = False +    preX = copy.copy(curX) +if ans: +    print("Yes") +else: +    print("No")