object Main {

  def main(args: Array[String]): Unit = {
    import scala.io.StdIn._

    val c = (0 until 3).map { _ =>
      readLine().split(" ").map(_.toInt)
    }. toArray

    val forI = (0 until 2) forall { i =>
      (0 until 2) forall { j =>
        (c(i)(j) - c(i+1)(j)) == (c(i)(j+1) - c(i+1)(j+1))
      }
    }
    val forJ = (0 until 2) forall { j =>
      (0 until 2) forall { i =>
        (c(i)(j) - c(i)(j+1)) == (c(i+1)(j) - c(i+1)(j+1))
      }
    }

    if (forI && forJ)
      println("Yes")
    else
      println("No")
  }

}