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)]

expected_cnt = [0] * N
for i in range(1, N):
    expected_cnt[i] = expected_cnt[i - 1] + (1 / i)

factorial = 1
for i in range(1, N):
    factorial *= i
    factorial %= MOD


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