import java.util.Scanner

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val c = Array<Int>(9, { 0 })
    for (i in (0..8)) {
        c[i] = scanner.nextInt()
    }
    for (i in (0..1)) {
        for (j in (0..1)) {
            if (c[i + 3 * j] + c[i + 3 * j + 4] != c[i + 3 * j + 1] + c[i + 3 * j + 3]) {
                println("No")
                return
            }
        }
    }
    println("Yes")
}