fun main(args: Array<String>) {
    val c1 = readIntList()
    val c2 = readIntList()
    val c3 = readIntList()
    val v1 = listOf(c1[0], c2[0], c3[0])
    val v2 = listOf(c1[1], c2[1], c3[1])
    val v3 = listOf(c1[2], c2[2], c3[2])
    val diffH1 = c2.mapIndexed { index, i -> i - c1[index] }
    val diffH2 = c3.mapIndexed { index, i -> i - c2[index] }
    val diffV1 = v2.mapIndexed { index, i -> i - v1[index] }
    val diffV2 = v3.mapIndexed { index, i -> i - v2[index] }
    printYesOrNo(
            diffH1[0] == diffH1[1] && diffH1[0] == diffH1[2] &&
                    diffH2[0] == diffH2[1] && diffH2[0] == diffH2[2] &&
                    diffV1[0] == diffV1[1] && diffV1[0] == diffV1[2] &&
                    diffV2[0] == diffV2[1] && diffV2[0] == diffV2[2]
    )
}

fun printYesOrNo(flag: Boolean) {
    println(if (flag) "Yes" else "No")
}

fun readIntList(): List<Int> = readLine()!!.split(' ').map { it.toInt() }

fun readInt(): Int = readLine()!!.toInt()

fun err(print: Any) {
    System.err.println(print)
}