n, *x = map(int, open(0).read().split())

mod = 10 ** 9 + 7

y = []
for i in range(n - 1):
    y.append(x[i + 1] - x[i])

fac = [1] * (n + 1)
for i in range(1, n):
    fac[i] = fac[i - 1] * i % mod

dp = [0] * n
ans = 0
p = 0

for i in range(n - 1):
    p = (p + pow(i + 1, mod - 2, mod))
    ans = (ans + p * y[i]) % mod

print(ans * fac[n - 1] % mod)
