#include<bits/stdc++.h>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;++A)
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
#define MOD (ll)(1e9 + 7)

ll moddiv(ll a,ll b){
    a %= MOD;
    b %= MOD;
    for(ll m=MOD-2;m>0;m/=2){
        if(m&1){
            a=a*b%MOD;
        }
        b=b*b%MOD;
    }
    return a;
}

ll N;
ll X[101010];
ll Fa[101010];
ll i, j, ans;
int main(){
    scanf("%lld", &N);
    fornum(i,0,N){
        scanf("%lld", &X[i]);
    }

    Fa[0] = 1;
    fornum(i,0,N){
        Fa[i + 1] = Fa[i] * (i + 1) % MOD;
    }

    j = 0;
    fornum(i,1,N){
        j += moddiv(Fa[N - 1], Fa[i]) * Fa[i - 1];
        j %= MOD;
        ans = (ans + j * (X[i] - X[i - 1])) % MOD;
    }
    printf("%lld", ans);

    return 0;
}