import numpy as np
from math import factorial
MOD = 10**9 + 7

n = int(input())

dist = np.diff(list(map(int, input().split()))) % MOD
L = np.cumsum(np.array([1 / x for x in range(1, n)])) % MOD
# n_1 = factorial(n-1) % MOD

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

# print(int(np.sum(L * dist * n_1)) % MOD)
# ans = 0
# for l, d in zip(L, dist):
#     ans += ((l % MOD) * (d % MOD) * (n_1 % MOD)) % MOD
# print(int(ans) % MOD)
print(int(np.sum(dist * L * (fac[-1])) % MOD))