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

n = int(input())
dist = np.diff(list(map(int, input().split())))

# L = np.cumsum(np.array([1 / x for x in range(1, n)]))
# n_1 = factorial(n-1) % MOD

# print(int((np.sum(L * dist) * n_1) % MOD))

# ans = 0
# for l, d in zip(L, dist):
#     ans += (l * d * (n_1 % MOD)) % MOD

# print(int(ans) % MOD)

L = np.cumsum(np.array([1 / x for x in range(1, n)]))
n_1 = factorial(n-1) % MOD
L *= n_1
 
print(int(np.sum(L * (dist % MOD)) % MOD))