fun main(args: Array<String>) {
    val C = (1..3).map { readLine()!!.split(" ").map { it.toInt() } }

    val B = arrayOf(C[0][0], C[0][1], C[0][2])
    val A = arrayOf(0,C[1][1]-B[1], C[2][2]-B[2])

    val a = arrayListOf<Boolean>()
    for (i in 0..2) {
        for (j in 0..2) {
            a.add(C[i][j]==A[i]+B[j])
        }
    }
    println(if(a.fold(true) {x,y->x&&y}) "Yes" else "No")
}