# B - Fusing Slimes

N = int(input())
x = list(map(int, input().split()))
MOD = 10**9 + 7

# n! (MOD p)
def factorial_mod(n, p):
    tmp = 1
    for i in range(1, n+1):
        tmp *= i
        tmp %= p
    return tmp

# 逆数の累積和
rv = [1]
for i in range(2, N):
    rv.append(rv[-1] + pow(i, MOD-2, MOD))

ans = 0
for i in range(N-1):
    ans += ((x[i+1] - x[i]) * rv[i]) % MOD

ans *= factorial_mod(N-1, MOD)
ans %= MOD
print(ans)