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

template <long long mod>
class Mod
{
    long long value;
    void set_value(const long long x)
    {
        this->value = x % mod;
    }

public:
    Mod()
    {
        set_value(0ll);
    }

    template <typename T>
    Mod(T x = 0)
    {
        set_value((long long)x);
    }

    friend istream &operator>>(istream &is, Mod &x)
    {
        long long tmp;
        is >> tmp;
        x.set_value(tmp);
        return is;
    }

    friend ostream &operator<<(ostream &os, const Mod &x)
    {
        os << x.value;
        return os;
    }

    operator long long() const
    {
        return this->value;
    }

    template <typename T>
    bool operator<(const T x)
    {
        return this->value < (long long)x;
    }

    template <typename T>
    bool operator<=(const T x)
    {
        return this->value <= (long long)x;
    }

    template <typename T>
    bool operator>(const T x)
    {
        return this->value > (long long)x;
    }

    template <typename T>
    bool operator>=(const T x)
    {
        return this->value >= (long long)x;
    }

    template <typename T>
    bool operator==(const T x)
    {
        return this->value == (long long)x;
    }

    template <typename T>
    Mod &operator=(const T x)
    {
        set_value((long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator&=(const T x)
    {
        set_value(this->value & (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator|=(const T x)
    {
        set_value(this->value | (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator^=(const T x)
    {
        set_value(this->value ^ (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator<<=(const T x)
    {
        set_value(this->value << (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator>>=(const T x)
    {
        set_value(this->value >> (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator+=(const T x)
    {
        set_value(this->value + (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator-=(const T x)
    {
        set_value(this->value - (long long)x + mod);
        return *this;
    }

    template <typename T>
    Mod &operator*=(const T x)
    {
        set_value(this->value * (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator/=(const T x)
    {
        long long a = (long long)x;
        long long b = mod;
        long long u = 1;
        long long v = 0;
        while (b)
        {
            long long t = a / b;
            a -= t * b;
            swap(a, b);
            u -= t * v;
            swap(u, v);
        }
        u %= mod;
        if (u < 0)
            u += mod;
        *this *= Mod(u);
        return *this;
    }

    template <typename T>
    Mod operator&(const T x) const
    {
        return Mod(*this) &= x;
    }

    template <typename T>
    Mod operator|(const T x) const
    {
        return Mod(*this) |= x;
    }

    template <typename T>
    Mod operator^(const T x) const
    {
        return Mod(*this) ^= x;
    }

    template <typename T>
    Mod operator<<(const T x) const
    {
        return Mod(*this) <<= x;
    }

    template <typename T>
    Mod operator>>(const T x) const
    {
        return Mod(*this) >>= x;
    }

    template <typename T>
    Mod operator+(const T x) const
    {
        return Mod(*this) += x;
    }

    template <typename T>
    Mod operator-(const T x) const
    {
        return Mod(*this) -= x;
    }

    template <typename T>
    Mod operator*(const T x) const
    {
        return Mod(*this) *= x;
    }

    template <typename T>
    Mod operator/(const T x) const
    {
        return Mod(*this) /= x;
    }

    Mod &operator++()
    {
        *this += 1;
        return *this;
    }

    Mod &operator--()
    {
        this->set_value(--this->value);
        return *this;
    }

    Mod operator++(auto)
    {
        Mod ret(*this);
        ++*this;
        return ret;
    }

    Mod operator--(auto)
    {
        Mod ret(*this);
        --*this;
        return ret;
    }
};

int main()
{
    const long long MOD = 1e9 + 7;
    int N;
    cin >> N;
    vector<long long> x(N);
    for (long long &xx : x)
    {
        cin >> xx;
    }

    Mod<MOD> factorial = 1;
    Mod<MOD> coef = 0;
    for (int i = 1; i < N; i++)
    {
        factorial *= i;
    }

    Mod<MOD> ans = 0;
    for (int i = 1; i < N; i++)
    {
        coef += factorial / i;
        ans += coef * (x[i] - x[i - 1]);
    }
    cout << ans << endl;
}


Measured memory_bytes: 1024