program tenquestionten
 integer,allocatable,dimension(:) :: X
 integer,allocatable,dimension(:) :: Y
 integer,allocatable,dimension(:) :: T
 integer N, i, j, sum, Xl, Yl, Tl, Z
 read(*,*) N
 allocate(X(N+1))
 allocate(Y(N+1))
 allocate(T(N+1))
 sum=0
 X(1) = 0
 Y(1) = 0
 T(1) = 0
  do i=2,N+1
  read(*,*) T(i), X(i), Y(i)
  end do
  do i=1,N
  Xl=abs(X(i+1)-X(i))
  Yl=abs(Y(i+1)-Y(i))
  Tl=abs(T(i+1)-T(i))
  Z=Xl+Yl
   if (Z.ge.Tl) then
    if ((mod(Z,2)).eq.(mod(Tl,2))) then
    sum = sum + 1
    end if
   end if
  end do
 if (sum.eq.N-1) then
 write(*,*) "YES"
 else if (sum.ne.N-1) then
 write(*,*) "NO"
 end if
end program