let () = Scanf.scanf "%d\n" @@ fun n ->
  Array.init n (fun _ ->
    Scanf.scanf "%d %d %d\n" @@ fun t x y -> t, x, y)
  |> Array.fold_left (fun (acc, txy') txy -> ((txy', txy) :: acc, txy)) ([], (0, 0, 0))
  |> fst
  |> List.for_all (fun ((t, x, y), (t', x', y')) ->
      let d = abs (x - x') + abs (y - y') in
      let dt = t' - t in
      d <= dt && (d - dt) mod 2 = 0)
  |> (function true -> "Yes" | false -> "No")
  |> print_endline