fun main(args: Array<String>) {
    val cs = readInputLine().split(" ").map { it.toInt() }.toMutableList()
    cs.addAll(readInputLine().split(" ").map { it.toInt() }.toList())
    cs.addAll(readInputLine().split(" ").map { it.toInt() }.toList())
    
    for (a1 in -100..100) {
        for (a2 in -100..100) {
            for (a3 in -100..100) {
                val bs = listOf(cs[0] - a1, cs[1] - a1, cs[2] - a1)
                var ok = true

                for (i in 3..5) {
                    if (cs[i] != a2 + bs[i % 3]) {
                        ok = false
                        break
                    }
                }
                if (!ok) {
                    continue
                }
                
                for (i in 6..8) {
                    if (cs[i] != a3 + bs[i % 3]) {
                        ok = false
                        break
                    }
                }
                if (ok) {
                    println("Yes")
                    return
                }
            }
        }
    }
    
    println("No")
}

fun readInputLine(): String {
    return readLine()!!
}
