#include <bits/stdc++.h>

#define ff first
#define ss second
#define pb push_back

using namespace std;
using ll = long long;
using ii = pair<int, int>;

const int N = 100005;
const int mod = 1e9+7;

int n;
ll fat[N];

ll inv(ll b){
	ll ans = 1;
	ll e = mod - 2;
	while(e){
		if(e&1){
			ans = (ans * b) % mod;
		}
		e >>= 1;
		b = (b * b) % mod;
	}
	return ans;
}

int main() {
	fat[0] = 1;
	for(int i = 1; i < N; i++){
		fat[i] = (fat[i-1] * i) % mod;
	}
	ll v[N];
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%lld", v+i);
	}
	ll ans = 0;
	n--;
	ll ant = 0;
	for(int i = 0; i < n; i++){
		ll val = v[i+1] - v[i];
		ant = ant + (fat[n] * inv(i+1)) % mod;
		ant %= mod;
		ans += (val * ant) % mod;
		ans %= mod;
	}
	printf("%lld\n", ans);
	return 0;
}
