object main extends App {
  val line1 = readLine.split(" ").map(_.toInt)
  val line2 = readLine.split(" ").map(_.toInt)
  val line3 = readLine.split(" ").map(_.toInt)
  val tr = line1(0) + line2(1) + line3(2)
  val sum1 = line1(0) + line2(2) + line3(1)
  val sum2 = line1(1) + line2(2) + line3(0)
  val sum3 = line1(1) + line2(0) + line3(2)
  val sum4 = line1(2) + line2(1) + line3(0)
  val sum5 = line1(2) + line2(0) + line3(1)
  var b = true
  b = b && tr == sum1
  b = b && tr == sum2
  b = b && tr == sum3
  b = b && tr == sum4
  b = b && tr == sum5
  println(if(b) "Yes" else "No")
}
