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
L *= n_1

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