let rec routable step (pTxy: int list, txy: int list) =
    if step = txy.Head - pTxy.Head then
        pTxy.Tail = txy.Tail
    else
        let [t; x; y] = pTxy
        routable (step + 1) ([t; x + 1; y], txy)
        || routable (step + 1) ([t; x - 1; y], txy)
        || routable (step + 1) ([t; x; y + 1], txy)
        || routable (step + 1) ([t; x; y - 1], txy)

let n = stdin.ReadLine() |> int
let txys = Seq.append [[0; 0; 0]] [for i in 1..n do yield stdin.ReadLine().Split(' ') |> Array.map int |> Array.toList]
txys
|> Seq.pairwise
|> Seq.forall (routable 0)
|> fun r -> if r then "Yes" else "No"
|> printfn "%s"
