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

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

L = np.array([1 / x for x in range(1, n)])

L = np.cumsum(L)
n_1 = factorial(n-1)
L *= n_1

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