#include <bits/stdc++.h>

using namespace std;

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 1
#define mp(a,b) make_pair(a,b)

lli inv[200200];

lli mod_pow(lli a,lli b){
	a %= MOD;
	if(b==0)return 1;
	if(b==1)return a;
	lli res = mod_pow(a,b/2)%MOD;
	res *= res;
	res %= MOD;
	if(b%2)res *=a;
	return res%MOD;
}

signed main(){

	lli n;
	cin>>n;
	vector<lli> x(n);
	REP(i,0,n)cin>>x[i];

	//invMake;
	inv[0]=1;
	REP(i,1,150150)inv[i] = inv[i-1]*i%MOD;

	vector<lli> cnt(n+5,0);
	REP(i,1,n+4){
		cnt[i] = inv[n-1] * mod_pow(i,MOD-2)%MOD;
		cnt[i] += cnt[i-1];
		cnt[i] %= MOD;
	}

	lli ans = 0;
	REP(i,0,n-1){
		ans += (x[i+1]-x[i])*cnt[i+1]%MOD;
		ans %=MOD;
	}
	cout<<ans<<endl;

	return 0;
}
