#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef long long ll;
const ll N_MAX = 100000;

const ll MOD = 1000000007;

ll inv[N_MAX],fac[N_MAX],finv[N_MAX];

void init(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<N_MAX;i++){
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        fac[i]=fac[i-1]*(ll) i%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    int N;
    ll x[100000];
    cin >> N;
    init();
    for(int i = 0; i < N; i++) cin >> x[i];
    ll cur = 0;
    ll ans = 0;
    for(int i = 1; i < N; i++){
        cur += inv[i];
        ans += (cur*(x[i]-x[i-1]))%MOD;
        ans %= MOD;
    }
    ans *= fac[N-1];
    ans %= MOD;
    cout << ans << endl;
}