from itertools import*
n,*c=map(int,open(0).read().split())
mod=10**9+7
dif=[j-i for i,j in zip(c,c[1:])]
fac=[1]*n
for i in range(1,n):
	fac[i]=fac[i-1]*i%mod
inv=[pow(i,mod-2,mod) for i in range(n)]
acc_inv=list(accumulate(inv))
ans=0
for k in range(1,n):
	ans+=dif[k-1]*acc_inv[k]
	ans%=mod
print(ans*fac[-1]%mod)