n = int(input())
l = list(map(int, input().split()))
n_ = n + 3
mod = 10**9+7
fun = [1]*(n_+1)
for i in range(1,n_+1):
    fun[i] = fun[i-1]*i%mod
rev = [1]*(n_+1)
rev[n_] = pow(fun[n_],mod-2,mod)
for i in range(n_-1,0,-1):
    rev[i] = rev[i+1]*(i+1)%mod
revs = [rev[i+1]*fun[i] for i in range(n_)]
for i in range(n_-1):
  revs[i+1] = (revs[i+1] + revs[i])%mod
ans = 0
for i in range(n-1):
  ans += (l[i+1]-l[i])*revs[i]
  ans %= mod
print(ans*fun[n-1]%mod)