#include <bits/stdc++.h>
using namespace std;
using ll = long long;

const int MOD = 1e9+7;
const int MAX_N = 1e5+12;
int n;
ll x[MAX_N];
ll prob[MAX_N];

ll powmod(ll x, ll y)
{
	ll res = 1;
	while(y){
		if(y&1) (res*=x)%=MOD;
		(x*=x)%=MOD;
		y>>=1;
	}
	return res;
}

void solve()
{
	prob[1]=1;
	for(int i=2;i<n;++i) prob[i]=(prob[i-1]+powmod(i,MOD-2))%MOD;
	ll ans = 0;
	for(int i=1;i<n;++i) (ans+=(x[i]-x[i-1])*prob[i])%=MOD;
	for(int i=1;i<n;++i) (ans*=i)%=MOD;
	cout<<ans<<'\n';
}

int main()
{
	cin >> n;
	for(int i=0;i<n;++i) cin >> x[i];
	solve();
	return 0;
}