#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
const int INF = int (1e9) + int (1e5);
const ll INFL = ll(2e18) + ll(1e10);
const ui MOD = 1E9 + 7;
const double EPS = 1e-9;
#define FOR(i,n) for (int i=0;i<(n);++i)
#define ROF(i,x) for(int i = (x) ; i >= 0 ; --i)
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define ODD(x) (((x)&1)==0?(0):(1))
#define sign(x) ((x > 0) - (x < 0))
#define dbg(x) cerr << #x"= " << x << endl

std::mt19937_64  generator(std::chrono::system_clock::now().time_since_epoch().count());

inline ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a, ll b) { return a ? gcd(b%a, a): b; }
ll lcm(ll a, ll b) { return a / gcd(a,b) * b; }


void READ(bool _local){
    ios_base::sync_with_stdio(false); cin.tie(0);
#ifdef _DEBUG
    if (_local)
        freopen ("in.txt", "r", stdin);
#endif
}


template<const int MOD>
struct ModInt {
    ui x;
    ModInt() : x(0) { }
    ModInt(int y) {int my = y % MOD; if(my < 0) my += MOD; x = my;}
    ModInt(ui y)  {int my = y % MOD; if(my < 0) my += MOD; x = my;}
    ModInt(ll y)  { ll my = y % MOD; if(my < 0) my += MOD; x = my;}
    ModInt(ull y) { ll my = y % MOD; if(my < 0) my += MOD; x = my;}
    ui get() const {return x;}

    ModInt &operator+= (ModInt that) {if((x += that.x) >= MOD) x -= MOD; return *this;}
    ModInt &operator-= (ModInt that) {if((x += MOD - that.x) >= MOD) x -= MOD; return *this;}
    ModInt &operator*= (ModInt that) {x = (ull) x * that.x % MOD; return *this;}
    ModInt &operator/= (ModInt that) {x = (*this * that.mul_inv()).get(); return *this;}
    ModInt &operator++ () {if (++x==MOD) x=0; return *this;}
    ModInt &operator-- () {if (--x<0) x=MOD-1;return *this;}

    ModInt operator+ (ModInt that) const {return ModInt(*this) += that;}
    ModInt operator- (ModInt that) const {return ModInt(*this) -= that;}
    ModInt operator* (ModInt that) const {return ModInt(*this) *= that;}
    ModInt operator/ (ModInt that) const {return ModInt(*this) /= that;}
    ModInt operator++ (int) {ModInt y=*this; if (++x==MOD) x=0; return y;}
    ModInt operator-- (int) {ModInt y=*this; if (--x<0) x=MOD-1; return y;}

    ostream& operator<<(ostream &stream){return stream<<x;}
    ModInt mul_inv() {
        ll b = MOD, t, q;
        ll x0 = 0, x1 = 1;
        ll a = this->get();
        while(a > 1) {
            q = a / b;
            t = b, b = a % b, a = t;
            t = x0, x0 = x1 - q * x0, x1 = t;
        }
        ModInt ret = x1;
        return ret;
    }

    ModInt pow(ull y) {
        ModInt res = 1 , z = *this;
        while(y) {
            if(y & 1) res *= z;
            z *= z;
            y >>= 1;
        }
        return res;
    }
};
typedef ModInt<MOD> mint;



int main() {
    READ(0);
    int n;cin>>n;
    vector<int> x(n);
    FOR(i,n) cin>>x[i];
    mint prob[n];
    prob[1]=1;
    for(int i=2;i<n;++i) prob[i] = prob[i-1] + powmod(i,MOD-2,MOD);
    mint ret=0;
    for(int i=1;i<n;++i){
        ret += prob[i]*(x[i]-x[i-1]);
    }
    for(int i=2;i<n;++i) ret *= i;
    cout << ret.get();
    return 0;
}



Measured memory_bytes: 1024