#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;

ll mod = 1e9 + 7;

vector<ll> fact;

void init_fact(int n) {
    fact = vector<ll>(n);
    fact[0] = 1;
    for (int i = 1; i < n; i++) fact[i] = fact[i - 1] * i % mod;
}

ll calc_pow(ll x, ll pow) {
    if (pow == 0) return 1;
    ll a = calc_pow(x, pow / 2);
    a = a * a % mod;
    if (pow % 2 == 1) a *= x;
    return a % mod;
}

ll calc_div(ll a, ll b) {
    return a * calc_pow(b, mod - 2) % mod;
}

int main() {
    init_fact(200000);

    int n, prev;
    cin >> n >> prev;

    ll prob = 0, ret = 0;
    for (int i = 1; i < n; i++) {
        prob += calc_div(fact[n - 1], i), prob %= mod;

        int now;
        cin >> now;
        ret += (now - prev) * prob, ret %= mod;
        prev = now;
    }

    cout << ret << endl;
    return 0;
}