N=int(input())
list1=[]
for i in range(N):
    a=list(map(int,input().split()))
    list1.append(a)
#print(list1)
list2=[0*N]
t0=0
x0=0
y0=0

for i in range(len(list1)):
    t=list1[i][0]-t0
    x=list1[i][1]-x0
    y=list1[i][2]-y0
    if t%2==0:
        for j in range(t//2):
            if y==(-x)+2j and 0<=x<=2j:
                list2[i]=1
                break
    elif t%2--1:
        for j in range((t-1)//2):
            if y==(-x)+2j+1 and 0<=x<=2j+1:
                list2[i]=1
                break
    t0=t
    x0=x
    y0=y
if list2==[1*N]:
    print("YES")
else:
    print("NO")

