SIZE=100010; MOD=10**9+7 #998244353 #ここを変更する

SIZE += 1
inv = [0]*SIZE  # inv[j] = j^{-1} mod MOD
inv[1] = 1
for i in range(2,SIZE):
    inv[i] = MOD - (MOD//i)*inv[MOD%i]%MOD

# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read

n = int(input())
x = [int(i) for i in readline().split()]

dx =[j-i for i,j in zip(x,x[1:])]

from itertools import accumulate
acc = list(accumulate(inv))

#print(dx)
#print(acc[:10])
ans = 0
for i,di in enumerate(dx):
    ans += di*acc[i+1]
    ans %= MOD

#print(ans)

for i in range(1,n):
    ans *= i
    ans %= MOD
print(ans)



    
