import numpy as np

mod = 10**9 + 7
stdin = np.array([int(_) for _ in open(0).read().split()])
N, X = stdin[0], stdin[1:]
A = np.array([pow(i, mod - 2, mod) for i in range(N)])
D = X[1:] - X[:-1]
f = 1
for i in range(1, N):
    f *= i
    f %= mod
A = np.cumsum(A)
A *= f
A %= mod
A[1:] *= D
A %= mod
print(np.sum(A) % mod)
