import sys
import math
#import numpy as np

stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split())) # applies to numbers only
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

def F(i):
    return (limit // i)%MOD

def Z(s, t):
    return (s*t)%MOD

N = ri()
X = rl()
MOD = 10 ** 9 + 7
limit = math.factorial(N-1)
last = X[-1]
X = [last - x for x in X[:-1]] #最後までの距離
Y = [F(i) for i in range(1, N)]
answer = 0
for x, y in zip(X, Y):
    answer += Z(x, y)
    answer %= MOD

print(answer)