#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
typedef long long ll;

const ll mod = 1000000007;

ll kaijou(ll n)
{
    if (n <= 1)
        return 1;
    else
        return (n * kaijou(n - 1)%mod) % mod;
}

int main(){
    int n;
    cin >> n;
    ll x[n];
    ll y;
    ll kai = kaijou(n-1);
    rep(i, n) cin >> x[i];
    y = 1.0 * kai;
    ll sum = 0;

    rep(i, n-1) {
        sum += y( * (x[i+1]-x[i]))%mod;
        y += (1.0/(i+2.0) * kai)%mod;
    }

    cout << sum << endl;
    
    return 0;
}