import math

N = int(input())

x = [0] * N
x = list(map(int, input().split()))

def calc_c(n):
    rslt = 0
    for i in range(1,n+1):
        rslt += 1/i
    return rslt


ans = 0
for i in range(1, N):
    ans += (x[i] - x[i-1]) * calc_c(i)



print(int(ans * math.factorial(N - 1)) % 1000000007)