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

#define rep(i, n) for(int i = 0; i < (n); ++i)

typedef long long ll;
typedef pair<int, int> P;

const int MAX = 1e5 + 5;
const int INF = 1001001001;
const int MOD = 1e9 + 7;

int main(){
    int N;
    cin >> N;

    vector<int> X(N);
    rep(i, N) cin >> X[i];

    vector<ll> fact(N + 1);
    fact[0] = 1;
    for (int i = 1; i <= N; ++i) {
        fact[i] = fact[i - 1] * i % MOD;
    }

    vector<ll> inv(N + 1);
    inv[1] = 1;
    for (int i = 2; i <= N; ++i) {
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
    }

    vector<ll> V(N);
    V[0] = 1;
    for (int i = 1; i < N; ++i) {
        V[i] = V[i - 1] + 1.0 * inv[i + 1];
        V[i] %= MOD;
    }

    ll res = 0;
    rep(i, N - 1) {
        res += (X[i + 1] - X[i]) * V[i];
        res %= MOD;
    }

    ll ans = res * fact[N - 1];
    ans %= MOD;
    if (ans < 0) ans += MOD;

    cout << ans << endl;
}