# Fusing Slimes
N = int(input())
X = list(map(int, input().split()))
mod = 10 ** 9 + 7
rev_sum=[0 for i in range(N+1)]
#rev_sum[x]= 1/1+   1/x
for i in range(1,N+1):
    rev_sum[i]+=rev_sum[i-1]+pow(i,mod-2,mod)
ans=0
for i in range(N-1):
    ans+=(X[i+1]-X[i])*rev_sum[i+1]
    ans%=mod
for i in range(1,N):
    ans=ans*i
    ans%=mod
print(ans)