import math
N = int(input())
x = list(map(int, input().split()))
kyori = [x[i + 1] - x[i] for i in range(N - 1)]
MOD = 10 ** 9 + 7
kai = [0] * (N + 1)
kai[0] = 1
for i in range(1, N + 1):
    kai[i] = (kai[i - 1] * i) % MOD
c = [0] * N
c[0] = 1
for i in range(1, N):
    c[i] = c[i - 1] + (1 / (i + 1))
ans = 0
for i in range(N - 1):
    ans += (c[i] * kyori[i]) % MOD

print(int(ans * kai[N - 1] % MOD))