import java.math.BigDecimal

fun main(args: Array<String>) {
    dwacon6thPrelimsB()
}

fun dwacon6thPrelimsB() {
    val n = readLine()!!.toInt()
    val xList = readLine()!!.split(' ').map { it.toLong() }.toLongArray()

    val diffs = Array<BigDecimal>(n - 1) { BigDecimal.valueOf(xList[it + 1] - xList[it]) }

    var answer = BigDecimal.ZERO

    var c = BigDecimal.valueOf(1.0)

    for (i in diffs.indices) {
        answer += diffs[i] * c
        answer %= MOD
        c += BigDecimal.valueOf(1.0 / (i + 2))
    }

    for (i in 2L until n) answer = (answer * BigDecimal.valueOf(i)) % MOD

    println(Math.ceil(answer.toDouble()).toLong() % (Math.pow(10.0, 9.0) + 7).toLong())
}

private val MOD by lazy { BigDecimal.valueOf((Math.pow(10.0, 9.0) + 7).toLong()) }
