#include <bits/stdc++.h>
#define mod 1000000007
#define rep(i,n) for(int i=0;(i)<(n);i++)
typedef long long ll;
using namespace std;
int main(void){
    int n; cin >> n;
    int inv [100003];
    int x[100003];
    rep(i,n) cin >> x[i];
    int ans = 0;
    inv[1] = 1;
    for (int i = 2; i <= n; ++i)
        inv[i] = -1ll * (mod / i) * inv[mod % i] % mod;
    int tmp = 0;
    rep(i,n-1){
        tmp = (tmp + inv[i+1])%mod;
        ans = (1ll*(x[i+1]-x[i])*tmp + ans)%mod;
    }
    rep(i,n-1) ans = 1ll*ans*(i+1)%mod;
    cout << (ans+mod)%mod << endl;
}

