AtCoDeer the deer is going on a trip in a two-dimensional plane. In his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.  If AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1). Note that **he cannot stay at his place**. Determine whether he can carry out his plan.
from pprint import pprint

# import math
# import collections

n = int(input())

# a = list(map(int, input().split(' ')))
t, x, y = [0], [0], [0]
d = [0]

for i in range(1, n + 1):
    _t, _x, _y = map(int, input().split(' '))
    t.append(_t)
    x.append(_x)
    y.append(_y)

    d.append(abs(x[i] - x[0]) + abs(y[i] - y[0]))



movable = [False] * (n + 1)

for i in range(n + 1):
    if d[i] <= t[i] and (t[i] % 2 == d[i] % 2):
        movable[i] = True

if all(movable):
    res = 'YES'
else:
    res = 'NO'

# pprint(d)
# pprint(movable)
print(res)

from pprint import pprint

# import math
# import collections

n = int(input())

# a = list(map(int, input().split(' ')))
t, x, y = [0], [0], [0]
d = [0]
dd = [0]
td = [0]

for i in range(1, n + 1):
    _t, _x, _y = map(int, input().split(' '))
    t.append(_t)
    x.append(_x)
    y.append(_y)

    d.append(abs(x[i] - x[0]) + abs(y[i] - y[0]))
    dd.append(abs(x[i] - x[i-1]) + abs(y[i] - y[i-1]))
    td.append(t[i] - t[i-1])



movable = [False] * (n + 1)

for i in range(n + 1):
    if d[i] <= t[i] and (t[i] % 2 == d[i] % 2) and dd[i] <= td[i]:
        movable[i] = True

if all(movable):
    res = 'Yes'
else:
    res = 'No'

# pprint(d)
# pprint(movable)
print(res)
