import Control.Monad

tdiff xy1 xy2 =       (xy2 !! 0) - (xy1 !! 0)
xdiff xy1 xy2 = abs $ (xy2 !! 1) - (xy1 !! 1)
ydiff xy1 xy2 = abs $ (xy2 !! 2) - (xy1 !! 2)

movable xy1 xy2 =
  let t = tdiff xy1 xy2
      x = xdiff xy1 xy2
      y = ydiff xy1 xy2
  in x + y <= t && (t - x - y) `mod` 2 == 0
  

main = do
  n <- readLn
  ls <- replicateM n getLine
  let xys = [0, 0, 0] : (map (map read . words) $ ls)
  putStrLn $ if all (\x -> x) $ [ movable (xys !! (i-1)) (xys !! i) | i<-[1..length xys -1 ] ]
             then "YES"
             else "NO"
