#include <bits/stdc++.h>
using namespace std;
using Int = long long;
const Int MOD = 1000000007;
const Int MAX = 200000;
array<Int, MAX> fac, finv, inv;
void COMinit() {
    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() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    COMinit();
    int N; cin >> N;
    vector<Int> X(N); for (auto &x : X) cin >> x;
    vector<Int> A(N + 1);
    for (int i = 1; i <= N; i++) {
        A[i] = (A[i - 1] + inv[i]) % MOD;
    }
    Int ans = 0;
    for (int i = 0; i < N - 1; i++) {
        ans = (ans + (X[i + 1] - X[i]) * A[i + 1]) % MOD;
    }
    cout << ans * fac[N - 1] % MOD << endl;
    return 0;
}