import math

N = int(input())
x = list(map(int, input().split()))

dist = []
tmp = x[0]
for x in x[1:]:
    dist.append(x - tmp)
    tmp = x
    
ans = 0

for i in range(1, N):
    if i == 1:
        tmp = sum(dist) / (N-i)
    else:
        tmp = tmp + sum(dist[i-1:])/(N-1)
    ans += tmp
    ans = ans % (1e9 + 7)

ans = int(ans * math.factorial(N-1)) % (1e9 + 7)
print(int(ans))