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.
def check():
    N = int(input())
    t1,x1,y1 = [0,0,0]
    
    for _ in range(N):
        t2,x2,y2 = [int(i) for i in input().split(' ')]
        x_sub = abs(x1-x2)
        y_sub = abs(y1-y2)
        t_sub = t2 - t1
        t = t_sub - x_sub - y_sub
        if t < 0:
            return 'no'
        else:
            if t % 2 == 0:
                t1 = t2
                x1 = x2
                y1 = y2
            else:
                return 'no'
    return 'yes'

print(check())
def check():
    N = int(input())
    t1,x1,y1 = [0,0,0]
    
    for _ in range(N):
        t2,x2,y2 = [int(i) for i in input().split(' ')]
        x_sub = abs(x1-x2)
        y_sub = abs(y1-y2)
        t_sub = t2 - t1
        t = t_sub - x_sub - y_sub
        if t < 0:
            return 'No'
        else:
            if t % 2 == 0:
                t1 = t2
                x1 = x2
                y1 = y2
            else:
                return 'No'
    return 'Yes'
print(check())