MOD = 10 ** 9 + 7


def modFact(n):
    global MOD
    if n == 1:
        return 1
    else:
        return (n * modFact(n - 1)) % MOD


def prepare(n):
    global MOD
    modFacts = [0] * (n + 1)
    modFacts[0] = 1
    for i in range(n):
        modFacts[i + 1] = (modFacts[i] * (i + 1)) % MOD

    invs = [1] * (n + 1)
    invs[n] = pow(modFacts[n], MOD - 2, MOD)
    for i in range(n, 1, -1):
        invs[i - 1] = (invs[i] * i) % MOD

    return modFacts, invs


N = int(input())
X = list(map(int, input().split()))

Y = [0] * (N - 1)
for x in X:
    Y[0] += x
    Y[0] %= MOD
Y[0] -= X[0] * N
for i in range(1, N - 1):
    offset = (X[i] - X[i - 1])
    num = N - i
    Y[i] = Y[i - 1] - offset * num
    Y[i] %= MOD

modFacts, invs = prepare(N)

ans = 0
var = modFacts[N - 1]
for i in range(N - 1):
    j = i + 1
    b = N - j
    ans += Y[i] * var // b
    ans %= MOD

ans = ans * (invs[N - 1] * modFacts[N - 1]) % MOD

print(ans)
