fun main(args: Array<String>) {
  val c = (1..3).map{readLine()!!.split(" ").map{it.toInt()}}
  val rows = c.map{row ->
    (0..1).map{index ->
      row[index + 1] - row[index]
    }
  }

  val colums = (0..2).map{i ->
    (0..1).map{j ->
      c[i][j + 1] - c[i][j]
    }
  }
  if(judge(rows)&&judge(colums)) {
    println("Yes")
    return
  }
    println("No")
}

fun judge(list:List<List<Int>>): Boolean{
  return (0 until 2).all{index ->
    list[index] == list[index + 1]
  }
}