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())
list=[]
flag=True
for i in range (N):
    tuple=input()
    input_list=tuple.split()
    input_list=[int(i) for i in input_list]
    list.append(input_list)
for i in range(N):
    time=list[i][0]
    distance=abs(list[i][1])+abs(list[i][2])
    if distance<=time:
        if distance%2==time%2:
            continue
        else:
            flag=False
    else:
        flag=False
if flag:
    print("YES")
else:
    print("NO")

N=int(input())
list=[]
flag=True
for i in range (N):
    tuple=input()
    input_list=tuple.split()
    input_list=[int(i) for i in input_list]
    list.append(input_list)
for i in range(N):
    time=list[i][0]
    distance=abs(list[i][1])+abs(list[i][2])
    if distance<=time:
        if distance%2==time%2:
            continue
        else:
            flag=False
    else:
        flag=False
if flag:
    print("Yes")
else:
    print("No")
