# -*- coding: utf-8 -*-
import sys

N=input()
X=map(int, sys.stdin.readline().split())
L=map(lambda x: x**-1, range(N-1,0,-1))

L_RUISEKI=[]

for i,x in enumerate(L):
    if i==0: L_RUISEKI.append(x)
    else: L_RUISEKI.append(L_RUISEKI[-1]+x)

ans=0

for i in range(N-1):
    #print "===",i,"==="
    value=X[i+1]-X[i]
    #print "value :: ", value
    #print "kitaichi :: ",1+(N-1-i)*L_RUISEKI[i]
    #print "keisuu :: ",(N-1-i)
    ans+=value*(N-1-i)*L_RUISEKI[i]


mod=10**9+7
fact=[1]
fact_tmp = 1
for i in range(1, N+1):
    fact_tmp *= i
    fact_tmp %= mod
    fact.append(fact_tmp)

print ans*fact[N-1]%mod