#include<bits/stdc++.h>
const int N=1e5+5,mo=1e9+7;
int n,x[N],inv[N],i,ans,val;
int main(){
	for(i=1;i<N;++i)inv[i]=i==1?1:1ll*(mo-mo/i)*inv[mo%i]%mo;
	scanf("%d",&n);for(i=1;i<=n;++i)scanf("%d",x+i);
	for(i=1;i<n;++i)val=(val+inv[i])%mo,ans=(ans+1ll*val*(x[i+1]-x[i]))%mo;
	for(i=1;i<n;++i)ans=1ll*ans*i%mo;
	printf("%d\n",ans);
}