#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

ll rwpw(ll a, ll p=MOD-2){
	ll ret = 1ll;
	while(p){
		if(p%2){
			mul_mod(ret,a);
		}
		mul_mod(a,a);
		p /= 2;
	}
	return ret;
}

ll x[100100];

int main(void){
	int n,i,j,m;
	ll ans=0ll,tmp;
	cin >> n;
	for(i=0; i<n; ++i){
		cin >> x[i];
	}
	for(i=1; i<n; ++i){
		tmp = x[n-1] - x[i-1];
		mul_mod(tmp,rwpw(i));
		add_mod(ans,tmp);
	}
	for(i=1; i<n; ++i){
		mul_mod(ans,i);
	}
	cout << ans << endl;
	return 0;
}
