MOD = 10**9+7
N = int(input())
x = list(map(int,input().split()))

kaijo = 1
for i in range(1,N):
    kaijo *= i
    kaijo %= MOD
d = [0]*(N-1)
"""for i in range(N-1):
    d[i] = x[i+1] - x[i]
    d[i] %= MOD
"""
ans = 0
for i in range(1,N):
    prob = 0
    for j in range(1,i+1):
        prob += 1/j
    ans += (x[i]-x[i-1]) * prob
ans *= kaijo
ans %= MOD
ans = int(ans)
print(ans)