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.
n = int(input())
p = [[0, 0, 0]]

for i in range(0, n):
    t, x, y = [int(i) for i in input().split(" ")]
    p.append([t, x, y])

f = True

for i in range(0, n):
    d = (p[i + 1][0] - p[i][0]) - (abs(p[i][1] - p[i + 1][1]) + abs(p[i][2] - p[i + 1][2]))
    print(d)
    if  d <= 0:
        f = False
        break
    else:
        if d % 2 == 1:
            f = False
            break

if f:
    print("Yes")
else:
    print("No")
n = int(input())
p = [[0, 0, 0]]

for i in range(0, n):
    t, x, y = [int(i) for i in input().split(" ")]
    p.append([t, x, y])

f = True

for i in range(0, n):
    l = abs(p[i][1] - p[i + 1][1]) + abs(p[i][2] - p[i + 1][2])
    dt = p[i + 1][0] - p[i][0]
    if l == 0 and dt == 1:
        f = False
        break
    if dt < l:
        f = False
        break
    else:
        if (dt - l) % 2 == 1:
            f = False
            break

if f:
    print("Yes")
else:
    print("No")