from math import ceil
N = int(input())
X = list(map(int, input().split()))
MOD = 10 ** 9 + 7

# 間の距離を計算
distances = [0] + [X[i + 1] - X[i] for i in range(N - 1)]

# (N - 1)!を計算
factorial_n_1 = 1
for i in range(1, N):
    factorial_n_1 *= i
    factorial_n_1 %= MOD


expected_cnt = [0] * N
for i in range(1, N):
    expected_cnt[i] = expected_cnt[i - 1] + (factorial_n_1 * pow(i, MOD - 2, MOD)) % MOD

moves = [(d * e) % MOD for d, e in zip(distances, expected_cnt)]
print(sum(moves) % MOD)
