#include <bits/stdc++.h>
using namespace std;
const long long MOD = long long(1e9) + 7;
class NCK {
 private:
  long long m_mod;

 public:
  NCK(long long mod) : m_mod(mod) {}
  long long modPow(long long x, long long y) {
    long long r = 1, a = x;
    while (y > 0) {
      if ((y & 1) == 1) {
        r = (r * a) % m_mod;
      }
      a = (a * a) % m_mod;
      y /= 2;
    }
    return r;
  }
  long long modInverse(long long x) { return modPow(x, m_mod - 2); }
  long long modDivision(long long p, long long q) {
    return (p * modInverse(q)) % m_mod;
  }
  long long choose(long long n, long long k) {
    if (k > n) {
      return 0;
    }
    long long p = 1, q = 1;
    for (int i = 1; i <= k; i++) {
      q = (q * i) % m_mod;
      p = (p * (n - i + 1)) % m_mod;
    }
    return modDivision(p, q);
  }
  vector<vector<long long>> makeNckTableFrom00ToNN(long long n_max) {
    assert(n_max > 0);
    vector<vector<long long>> table(n_max + 1, vector<long long>(n_max + 1));
    table[0][0] = 1;
    for (int i = (1); i < (int)(n_max + 1); ++i) {
      table[i][0] = 1;
      for (int j = (1); j < (int)(n_max + 1); ++j) {
        table[i][j] = (table[i - 1][j - 1] + table[i - 1][j]) % m_mod;
      }
    }
    return table;
  }
  vector<long long> makeNckTableFromN0ToNN(long long n, long long k_max) {
    assert(n > 0);
    assert(n >= k_max);
    vector<long long> table(n + 1);
    table[0] = 1;
    long long p = 1, q = 1;
    table[0] = 1;
    for (int i = (1); i < (int)(k_max + 1); ++i) {
      q = (q * i) % m_mod;
      p = (p * (n - i + 1)) % m_mod;
      table[i] = modDivision(p, q);
    }
    return table;
  }
  vector<long long> makeTableFromN1CkToN2Ck(long long n1, long long n2,
                                            long long k) {
    vector<long long> table;
    long long tmp = -1;
    for (int n = (n1); n < (int)(n2 + 1); ++n) {
      if (n == n1) {
        tmp = this->choose(n, k);
      } else {
        tmp *= n;
        tmp %= this->m_mod;
        tmp = this->modDivision(tmp, n - k);
      }
      table.push_back(tmp);
    }
    return table;
  }
  vector<long long> makeModInverseTable(long long n_max) {
    assert(n_max > 0);
    vector<long long> table(n_max + 1);
    for (int i = (1); i < (int)(n_max + 1); ++i) {
      table[i] = modInverse(i);
    }
    return table;
  }
};
long long solve(long long N, vector<long long>& As) {
  NCK nck(MOD);
  vector<long long> dists;
  for (int i = 0; i < (int)(N - 1); ++i) {
    dists.push_back(As[i + 1] - As[i]);
  }
  long long dist_sum = accumulate((dists).begin(), (dists).end(), 0LL);
  long long factorial = 1;
  for (int n = 0; n < (int)(N - 1); ++n) {
    factorial *= (n + 1);
    factorial %= MOD;
  }
  long long ans = 0;
  for (int n = (2); n < (int)(N + 1); ++n) {
    ans += factorial * dist_sum;
    factorial *= (n - 1);
    factorial %= MOD;
    factorial = nck.modDivision(factorial, n);
    dist_sum -= dists[n - 2];
  }
  return ans % MOD;
}
int main(void) {
  cin.sync_with_stdio(false);
  long long N;
  cin >> N;
  vector<long long> As(N);
  for (int n = 0; n < (int)(N); ++n) cin >> As[n];
  cout << solve(N, As) << endl;
  return 0;
}
