open Core

let n = Scanf.scanf "%d" ident

let plans =
  List.init n (fun _ -> Scanf.scanf " %d %d %d" (fun t x y -> (t, x, y)))
  |> List.rev

let reachable np p =
  let nt, nx, ny = np in
  let t, x, y = p in
  let d1 = abs (nx - x) + abs (ny - y) in
  let dt = nt - t in
  if d1 <= dt && d1 mod 2 = dt mod 2 then true else false

let rec solve p = function
  | [] ->
      true
  | np :: rest ->
      if reachable np p then solve np rest else false

let str = if solve (0, 0, 0) plans then "Yes" else "No"

let () = print_endline str
