#include<iostream>
#include<vector>

const long long mod = 1000000007;

long long powMod(long long n,long long k,const long long p){
    long long res = 1;
    while(k > 0){
        if(k&1) res = res*n%p;
        k >>= 1;
        n = n*n%p;
    }
    return res;
}

int main(){
    long long n;
    std::cin >> n;
    std::vector<long long> delta(n-1,0);
    long long last;
    long long mother = 1;
    std::cin >> last;
    for(long long i=0; i<n-1; i++){
        long long x;
        std::cin >> x;
        delta.at(i) = x - last;
        last = x;
        mother = mother*(i+1)%mod;
    }
    long long total = 0, ans = 0;
    for(long long i=0; i<n-1; i++){
        long long now = (total*powMod(i+1,mod-2,mod)+1)%mod;
        ans += now*delta[i]%mod;
        ans %= mod;
        total += now;
        total %= mod;
    }
    std::cout << ans*mother%mod << "\n";
}
