object Main extends App {

  import scala.io.Source._

  val matrix = stdin.getLines().map(_.split(' ').map(_.toInt).toArray).toArray
  println(if ((1 to 2).forall(x => (0 to 2).map(y => matrix(x)(y) - matrix(x - 1)(y)).distinct.size == 1 && (0 to 2).map(y => matrix(y)(x) - matrix(y)(x - 1)).distinct.size == 1)){
    "Yes"
  }else{
    "No"
  })
}