object Main extends App {
	val c = Array.ofDim[Int](3,3)

	for(i<-0 until 3){
		c(i) = scala.io.StdIn.readLine.split(" ").map(_.toInt)
	}


	val d1 = c(0)(0) - c(0)(1)
	val d2 = c(1)(0) - c(1)(1)
	val d3 = c(2)(0) - c(2)(1)

	val d4 = c(0)(0) - c(0)(2)
	val d5 = c(1)(0) - c(1)(2)
	val d6 = c(2)(0) - c(2)(2)

	val d7 = c(0)(1) - c(0)(2)
	val d8 = c(1)(1) - c(1)(2)
	val d9 = c(2)(1) - c(2)(2)

	val e1 = c(0)(0) - c(1)(0)
	val e2 = c(0)(1) - c(1)(1)
	val e3 = c(0)(2) - c(1)(2)

	val e4 = c(1)(0) - c(2)(0)
	val e5 = c(1)(1) - c(2)(1)
	val e6 = c(1)(2) - c(2)(2)

	val e7 = c(0)(0) - c(2)(0)
	val e8 = c(0)(1) - c(2)(1)
	val e9 = c(0)(2) - c(2)(2)

	if(d1 == d2 && d1 == d3 && d4 == d5 && d4 == d6 && d7 == d9 && d7 == d8){
		if(e1 == e2 && e1 == e3 && e4 == e5 && e4 == e6 && e7 == e9 && e7 == e8){
			println("Yes")
		}else{
			println("No")
		}
	}else{
		println("No")
	}

}