#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U>
using P = pair<T, U>;
template <class T>
using Heap = priority_queue<T>;
template <class T>
using heaP = priority_queue<T, vector<T>, greater<T>>;
template <class T, class U>
using umap = unordered_map<T, U>;
template <class T>
using uset = unordered_set<T>;
template <class T>
bool ChangeMax(T& a, const T& b) {
  if (a >= b) return false;
  a = b;
  return true;
}
template <class T>
bool ChangeMin(T& a, const T& b) {
  if (a <= b) return false;
  a = b;
  return true;
}
template <class T, size_t N, class U>
void Fill(T (&a)[N], const U& v) {
  fill((U*)a, (U*)(a + N), v);
}
template <class T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto& e : v) is >> e;
  return is;
}
template <long long mod>
class modint {
 private:
  long long num;
  long long extgcd(long long a, long long b, long long& x, long long& y) const {
    long long d = a;
    if (b != 0) {
      d = extgcd(b, a % b, y, x);
      y -= (a / b) * x;
    } else {
      x = 1;
      y = 0;
    }
    return d;
  }
  long long modinverse() const {
    long long x, y;
    extgcd(num, mod, x, y);
    return (mod + x % mod) % mod;
  }

 public:
  modint() : num(0) {}
  modint(const long long x) : num((x < 0 ? (x + mod) : x) % mod) {}
  friend modint operator+(const modint& a, const modint& b) {
    return modint(a.num + b.num);
  }
  friend modint operator-(const modint& a, const modint& b) {
    return modint(a.num - b.num);
  }
  friend modint operator*(const modint& a, const modint& b) {
    return modint(a.num * b.num);
  }
  friend modint operator/(const modint& a, const modint& b) {
    return modint(a * b.modinverse());
  }
  modint& operator+=(const modint& b) { return (*this) = (*this) + b; }
  modint& operator-=(const modint& b) { return (*this) = (*this) - b; }
  modint& operator*=(const modint& b) { return (*this) = (*this) * b; }
  modint& operator/=(const modint& b) { return (*this) = (*this) / b; }
  modint& operator++() {
    (*this) += 1;
    return (*this);
  }
  modint& operator--() {
    (*this) -= 1;
    return (*this);
  }
  modint operator++(int) {
    modint tmp(*this);
    ++(*this);
    return tmp;
  }
  modint operator--(int) {
    modint tmp(*this);
    --(*this);
    return tmp;
  }
  friend ostream& operator<<(ostream& os, const modint& a) {
    os << a.num;
    return os;
  }
  friend istream& operator>>(istream& is, modint& a) {
    long long x;
    is >> x;
    a = x;
    return is;
  }
};
int main() {
  const ll mod = (1e+9) + 7;
  ll n;
  cin >> n;
  vector<ll> v(n);
  cin >> v;
  vector<ll> dif(n);
  for (ll i = 1; i < n; ++i) {
    dif[i] = v[i] - v[i - 1];
  }
  modint<mod> ans(0);
  vector<modint<mod>> kai(100010, 1);
  for (ll i = 1; i < 100010; ++i) {
    kai[i] = kai[i - 1] * i;
  }
  vector<modint<mod>> sum(100010, 0);
  for (ll i = 1; i < n; ++i) {
    sum[i] = sum[i - 1] * i + kai[i - 1];
  }
  for (ll i = 1; i < n; ++i) {
    ans += (sum[i] * dif[i]) * (kai[n - 1] / i);
  }
  cout << ans << endl;
  return 0;
}
