object Main extends App {
  val n = io.StdIn.readLine().toInt
  val list = collection.mutable.ListBuffer[Array[Int]](Array(0 ,0, 0))
  (1 to n).foreach { i =>
    list += io.StdIn.readLine().split(' ').map(_.toInt).toArray
  }
  def f(t: Int, x: Int, y: Int): Boolean = {
    if (t == 0) (x == 0 && y == 0)
    else if(x == 0 && y == 0 && t | 0 == 0) true
    else if (x < 0 || y < 0 || x > t || y > t || x + y > t) false
    else (f(t - 1, x + 1, y) || f(t - 1, x - 1, y) || f(t - 1, x, y + 1) || f(t - 1, x, y - 1))
  }
  list.zip(list.tail)
  val list2 = list.zip(list.tail).map{case (x1, x2) => (x2(0) - x1(0), Math.abs(x2(1) - x1(1)), Math.abs(x2(2) - x1(2)))}
  print(if(list2.forall{case (t, x, y) => f(t, x, y)}) "Yes" else "No")
}