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())
travel=[]
dif=[]
current=0
for i in range(n):
    travel.append(list(map(int,input().split())))
    dif.append(travel[-1][0]-current)
    current=travel[-1][0]
    
   
current=[0,0]
tamam=True
for i in range(n):
    need=abs(travel[i][1]-current[0])+abs(travel[i][2]-current[1])
    current=[travel[i][1],travel[i][2]]
    
    if dif[i] < need :
        tamam = False
        break
    elif (dif[i] - need) % 2 != 0 :
        tamam = False 
        break
if tamam :
    print("YES")
else:
    print("NO")
    
    
import sys
batch = 0
lines = 0
ans = []
for line in sys.stdin:
    if line == None or line == '\n':
        break
        
    cur = line.split(" ")
    if len(cur) == 1:
        lines = int(cur[0])
        batch = 0
        continue
    
    else:
        batch += 1
        if int(cur[0]) < int(cur[1]) + int(cur[2]):
            ans.append(0)
        elif (int(cur[0]) - int(cur[1]) - int(cur[2])) % 2 == 0:
            ans.append(1)
        else:
            ans.append(0)
        
        if batch == lines:
            prod = 1
            for n in ans:
                prod *= n
            if prod == 0:
                print("No")
            else:
                print("Yes")