fun main(args: Array<String>) {
    val c = mutableListOf<List<Int>>()
    for (i in 0 until 3) {
        c.add(readLine()!!.split(' ').map(String::toInt))
    }
    for ( i in 1 until 3) {
        for ( j in 1 until 3) {
            if (c[i][j] - c[i-1][j] != c[i][j-1] - c[i-1][j-1]) {
                println("No")
                return
            }
        }
    }
    for ( j in 1 until 3) {
        for ( i in 1 until 3) {
            if (c[i][j] - c[i][j-1] != c[i-1][j] - c[i-1][j-1]) {
                println("No")
                return
            }
        }
    }
    println("Yes")
}