#include <bits/stdc++.h>

#define MOD 1000000007ll
#define INV2 500000004ll

using namespace std;

typedef long long ll;
ll a[100005];
ll fact[100005];
ll dp[100005];

ll fast_pow(ll n, ll e){
    if(!e)
        return 1ll;
    ll tmp = (fast_pow(n,e/2ll));
    tmp = (tmp*tmp)%MOD;
    if(e&1)
        return (tmp*n)%MOD;
    return tmp;
}

int main(){
    ios::sync_with_stdio(0);
    int n;
    cin >> n;
    fact[0] = 1;
    for(int i = 1; i<=n; i++)
        fact[i] = (fact[i-1]*i)%MOD;
    for(int i = 0; i<n; i++)
        cin >> a[i];
    dp[1] = fact[n-1];
    for(int i = 2; i<n; i++){
        dp[i] = dp[i-1];
        ll adder = (fact[n-1]*fast_pow(i,MOD-2ll));
        dp[i] = (dp[i]+adder)%MOD;
    }
    ll ans = 0;
    for(int i = 1; i<n; i++){
        ll adder = (a[i]-a[i-1])*dp[i];
        adder %= MOD;
        ans = (ans+adder)%MOD;
    }
    cout << ans << "\n";
    return 0;
}