fun main(args: Array<String>) {
    val cList = mutableListOf<List<Int>>()
    var result = "No"
    for(i in 0 until 3){
        cList.add(readLine()!!.split(" ").map(String::toInt))
    }


val sumA = cList[0][0] + cList[1][1] + cList[2][2]
val sumB = cList[0][1] + cList[1][2] + cList[2][0]
val sumC = cList[0][2] + cList[1][0] + cList[2][1]

val judgeSum = (cList[0].sum() + cList[1].sum() + cList[2].sum()) / 3

if(sumA == judgeSum && sumB == judgeSum && sumC == judgeSum){
    result = "Yes"
}

println(result)

}