import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val c = Array(3) { Array(3) { sc.nextInt() } }

  var ok = true
  if (c[0][0] - c[1][0] != c[0][1] - c[1][1] ) {
    ok = false
  }
  if (c[0][0] - c[1][0] != c[0][2] - c[1][2] ) {
    ok = false
  }

  if (c[0][0] - c[2][0] != c[0][1] - c[2][1] ) {
    ok = false
  }
  if (c[0][0] - c[2][0] != c[0][2] - c[2][2] ) {
    ok = false
  }

  if (c[1][0] - c[2][0] != c[1][1] - c[2][1] ) {
    ok = false
  }
  if (c[1][0] - c[2][0] != c[1][2] - c[2][2] ) {
    ok = false
  }

  if (ok) {
    println("Yes")
    return
  }
  println("No")
}
