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

const ll MOD = 1e9+7;

const int MAX=100010;

vector<ll> fac(MAX), finv(MAX), inv(MAX);

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

int main() {
    int n;
    cin >> n;
    vector<ll> x(n);
    ll xin,oxin;
    for (int i=0;i<n;i++) {
        cin >> xin;
        if (i>0) x[i]=xin-oxin;
        oxin = xin;
    }
    vector<ll> p(n), sump(n);
    cmbInit();
    for (int i=1;i<n;i++) {
        p[i]=(fac[n-1]*inv[i])%MOD;
        if (i==1) sump[i]=p[i];
        else sump[i]=(p[i]+sump[i-1])%MOD;
    }
    
    ll ans=0;
    for (int i=1;i<n;i++) {
        ans+=(x[i]*sump[i])%MOD;
        ans=ans%MOD;
    }
    cout << ans << endl;
}