#include <bits/stdc++.h>
using namespace std;
long long fac[100010], inv[100010]; 
long long P = 1000000007;
void init() {
    fac[0] = fac[1] = 1; 
    inv[1] = 1; 
    for (int i = 2; i < 100005; i++) {
        fac[i] = fac[i - 1] * i % P;
        inv[i] = P - inv[P % i] * (P / i) % P;
    }
}
int main(){
	int N; cin >> N; init(); 
	long long X[114514] = {}; 
	for(int i = 0; i < N; i++) cin >> X[i]; 
	long long Y[114514] = {}; 
	for(int i = 0; i < N; i++) Y[i] = X[N-1] - X[i]; 
	long long ans = 0; 
	for(int i = 0; i < N; i++){
		long long tmp = Y[i] * inv[i+1] % P; 
		ans += tmp; ans %= P; 
	}
	ans *= fac[N-1]; ans %= P; 
	cout << ans << endl; 
}