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

#define rep(i, N) for (int i = 0; i < (N); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back

using ll = long long;
using i_i = tuple<int, int>;

const int MOD = 1e9 + 7;

int pow_mod(ll x, ll n, int M) {
    ll ans = 1;
    for (; n; n>>=1) {
        if (n & 1) ans = ans * x % M;
        x = x * x % M;
    }
    return ans;
}

int inv_mod(int x, int p) {
    return pow_mod(x, p - 2, p);
}

int main() {
    int N; cin >> N;
    vector<int> x(N);
    rep(i, N) cin >> x[i];
    vector<ll> a(N - 1);
    rep(i, N - 1) a[i] = x[i + 1] - x[i];
    N--;
    ll c = 0, ans = 0;
    rep(i, N) {
        c = (c + inv_mod(i + 1, MOD)) % MOD;
        ans = (ans + c * a[i]) % MOD;
    }
    for (int x = 1; x <= N; x++) ans = ans * x % MOD;
    cout << ans << endl;
}
