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

template <int mod = (int)(1e9 + 7)>
struct ModInt {
  int x;
  constexpr ModInt() : x(0) {}
  constexpr ModInt(int64_t y)
      : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
  constexpr ModInt &operator+=(const ModInt &p) noexcept {
    if((x += p.x) >= mod) x -= mod;
    return *this;
  }
  constexpr ModInt &operator-=(const ModInt &p) noexcept {
    if((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }
  constexpr ModInt &operator*=(const ModInt &p) noexcept {
    x = (int)(1LL * x * p.x % mod);
    return *this;
  }
  constexpr ModInt &operator/=(const ModInt &p) noexcept {
    *this *= p.inverse();
    return *this;
  }
  constexpr ModInt operator-() const { return ModInt(-x); }
  constexpr ModInt operator+(const ModInt &p) const
      noexcept {
    return ModInt(*this) += p;
  }
  constexpr ModInt operator-(const ModInt &p) const
      noexcept {
    return ModInt(*this) -= p;
  }
  constexpr ModInt operator*(const ModInt &p) const
      noexcept {
    return ModInt(*this) *= p;
  }
  constexpr ModInt operator/(const ModInt &p) const
      noexcept {
    return ModInt(*this) /= p;
  }
  constexpr bool operator==(const ModInt &p) const
      noexcept {
    return x == p.x;
  }
  constexpr bool operator!=(const ModInt &p) const
      noexcept {
    return x != p.x;
  }
  constexpr ModInt inverse() const noexcept {
    int a = x, b = mod, u = 1, v = 0, t = 0;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }
  constexpr ModInt pow(int64_t n) const {
    ModInt res(1), mul(x);
    while(n) {
      if(n & 1) res *= mul;
      mul *= mul;
      n >>= 1;
    }
    return res;
  }
  friend constexpr ostream &operator<<(
      ostream &os, const ModInt &p) noexcept {
    return os << p.x;
  }
  friend constexpr istream &operator>>(istream &is,
                                       ModInt &a) noexcept {
    int64_t t = 0;
    is >> t;
    a = ModInt<mod>(t);
    return (is);
  }
  constexpr int get_mod() { return mod; }
};

vector<ModInt<>> sum(100010);

ll inv(ll x) {
  ll res = 1;
  ll N = (long long)(1e9 + 7);
  ll k = N - 2;
  ll y = x;
  while(k) {
    if(k & 1) res = (res * y) % N;
    y = (y % N * y % N) % N;
    k /= 2;
  }
  return res;
}

int main(void) {
  long long n;
  cin >> n;
  vector<long long> x(n + 1);
  ModInt<> ans = 0;
  ModInt<> kaijo = 1;
  for(int i = 1; i <= n - 1; i++) kaijo = kaijo * i;
  for(int i = 0; i < n; i++) cin >> x[i + 1];
  for(int i = 0; i < n; i++)
    sum[i + 1] = (sum[i] + x[i + 1]);

  for(long long p = 1; p <= n - 1; p++) {
    ModInt<> tmp = inv(n - p) * (x[n] - x[p]);
    ans = ans + tmp;
  }
  for(long long p = 1; p <= n - 2; p++) {
    ModInt<> tmp = inv(p * (p + 1));
    ModInt<> tmp1 = sum[n - 1] - sum[p];
    ModInt<> tmp2 = sum[n - 1 - p];
    ModInt<> tmp3 = tmp1 - tmp2;
    ModInt<> tmp4 = tmp * tmp3;
    ans = ans + tmp4;
  }
  ans = ans * kaijo;
  cout << ans << endl;
  return 0;
}
