#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const int maxn=100010,mod=1000000007;
#define MP make_pair
#define PB push_back
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define ROF(i,a,b) for(int i=(a);i>=(b);i--)
#define MEM(x,v) memset(x,v,sizeof(x))
inline ll read(){
	char ch=getchar();ll x=0,f=0;
	while(ch<'0' || ch>'9') f|=ch=='-',ch=getchar();
	while(ch>='0' && ch<='9') x=x*10+ch-'0',ch=getchar();
	return f?-x:x;
}
int n,x[maxn],fac[maxn],inv[maxn],ans;
int main(){
	n=read();
	FOR(i,1,n) x[i]=read();
	fac[0]=fac[1]=inv[1]=1;
	FOR(i,2,n){
		fac[i]=1ll*fac[i-1]*i%mod;
		inv[i]=mod-1ll*(mod/i)*inv[mod%i]%mod;
	}
	FOR(i,1,n-1) ans=(ans+1ll*(x[n]-x[i])*inv[n-i])%mod;
	FOR(i,2,n-1) ans=(ans+1ll*x[i]*(1-inv[i]+mod))%mod;
	FOR(i,1,n-2) ans=(ans-1ll*x[i]*(1-inv[n-i]+mod)%mod+mod)%mod;
	ans=1ll*ans*fac[n-1]%mod;
	printf("%d\n",ans);
}