#include <bits/stdc++.h>
using namespace std;
const int INF = (0x7FFFFFFFL);
const long long INFF = (0x7FFFFFFFFFFFFFFFL);
const string ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int MOD = 1e9 + 7;
const int MODD = 998244353;
const string alphabet = "abcdefghijklmnopqrstuvwxyz";
const double PI = acos(-1.0);
const double EPS = 1e-9;
const string Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
int dx[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
int dy[9] = {0, 1, 0, -1, -1, -1, 1, 1, 0};
template <typename T>
void MACRO_VAR_Scan(T &t) {
  cin >> t;
}
template <typename First, typename... Rest>
void MACRO_VAR_Scan(First &first, Rest &...rest) {
  cin >> first;
  MACRO_VAR_Scan(rest...);
}
template <class T, class U>
ostream &operator<<(ostream &o, const pair<T, U> &j) {
  o << "{" << j.first << ", " << j.second << "}";
  return o;
}
template <class T, class U>
ostream &operator<<(ostream &o, const map<T, U> &j) {
  o << "{";
  for (auto t = j.begin(); t != j.end(); ++t)
    o << (t != j.begin() ? ", " : "") << *t;
  o << "}";
  return o;
}
template <class T>
ostream &operator<<(ostream &o, const set<T> &j) {
  o << "{";
  for (auto t = j.begin(); t != j.end(); ++t)
    o << (t != j.begin() ? ", " : "") << *t;
  o << "}";
  return o;
}
template <class T>
ostream &operator<<(ostream &o, const multiset<T> &j) {
  o << "{";
  for (auto t = j.begin(); t != j.end(); ++t)
    o << (t != j.begin() ? ", " : "") << *t;
  o << "}";
  return o;
}
template <class T>
ostream &operator<<(ostream &o, const vector<T> &j) {
  o << "{";
  for (int i = 0; i < (int)j.size(); ++i) o << (i > 0 ? ", " : "") << j[i];
  o << "}";
  return o;
}
inline int print(void) {
  cout << endl;
  return 0;
}
template <class Head>
int print(Head &&head) {
  cout << head;
  print();
  return 0;
}
template <class Head, class... Tail>
int print(Head &&head, Tail &&...tail) {
  cout << head << " ";
  print(forward<Tail>(tail)...);
  return 0;
}
template <typename T>
void PA(T &a) {
  int ASIZE = sizeof(a) / sizeof(a[0]);
  for (int ii = 0; ii < ASIZE; ++ii) {
    cout << a[ii] << " \n"[ii == ASIZE - 1];
  }
}
template <typename T>
void PV(T &v) {
  int VSIZE = v.size();
  for (int ii = 0; ii < VSIZE; ++ii) {
    cout << v[ii] << " \n"[ii == VSIZE - 1];
  }
}
inline int YES(bool x) {
  cout << ((x) ? "YES" : "NO") << endl;
  return 0;
}
inline int Yes(bool x) {
  cout << ((x) ? "Yes" : "No") << endl;
  return 0;
}
inline int yes(bool x) {
  cout << ((x) ? "yes" : "no") << endl;
  return 0;
}
inline int yES(bool x) {
  cout << ((x) ? "yES" : "nO") << endl;
  return 0;
}
inline int Yay(bool x) {
  cout << ((x) ? "Yay!" : ":(") << endl;
  return 0;
}
template <typename A, typename B>
void sankou(bool x, A a, B b) {
  cout << ((x) ? (a) : (b)) << endl;
}
inline long long MOP(long long x, long long n, long long m = MOD) {
  long long r = 1;
  while (n > 0) {
    if (n & 1) (r *= x) %= m;
    (x *= x) %= m;
    n >>= 1;
  }
  return r;
}
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
inline long long POW(long long a, long long b) {
  long long c = 1ll;
  do {
    if (b & 1) c *= 1ll * a;
    a *= 1ll * a;
  } while (b >>= 1);
  return c;
}
template <typename T, typename A, typename B>
inline bool between(T x, A a, B b) {
  return ((a <= x) && (x < b));
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <typename A, typename B>
inline bool chmax(A &a, const B &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename A, typename B>
inline bool chmin(A &a, const B &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
struct abracadabra {
  abracadabra() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);
    cerr << fixed << setprecision(5);
  };
} ABRACADABRA;
template <int MODULO>
struct ModInt {
  using int64 = int_fast64_t;
  using uint32 = uint_fast32_t;
  using uint64 = uint_fast64_t;
  uint64 x;
  ModInt() : x(0) {}
  ModInt(uint64 y) : x(set(y % MODULO + MODULO)) {}
  static uint64 set(const uint64 &y) { return (y < MODULO) ? y : y - MODULO; }
  static ModInt make(const uint64 &y) {
    ModInt ret = y;
    return ret;
  }
  ModInt operator+(const ModInt &m) const { return make(set(x + m.x)); }
  ModInt operator-(const ModInt &m) const {
    return make(set(x + MODULO - m.x));
  }
  ModInt operator*(const ModInt &m) const { return make(x * m.x % MODULO); }
  ModInt operator/(const ModInt &m) const { return make(x) * ~make(m.x); }
  ModInt &operator+=(const ModInt &m) { return *this = *this + m; }
  ModInt &operator-=(const ModInt &m) { return *this = *this - m; }
  ModInt &operator*=(const ModInt &m) { return *this = *this * m; }
  ModInt &operator/=(const ModInt &m) { return *this = *this / m; }
  ModInt &operator^=(const uint64 &y) { return *this = *this ^ y; }
  ModInt operator~() const { return *this ^ (MODULO - 2); }
  ModInt operator-() const { return make(set(MODULO - x)); }
  ModInt operator!() const {
    init(uint32(*this));
    return fact[uint32(*this)];
  }
  ModInt operator&() const {
    init(uint32(*this));
    return finv[uint32(*this)];
  }
  ModInt operator++() { return *this = make(set(x + 1)); }
  ModInt operator--() { return *this = make(set(x + MODULO - 1)); }
  bool operator==(const ModInt &m) const { return x == m.x; }
  bool operator!=(const ModInt &m) const { return x != m.x; }
  bool operator<(const ModInt &m) const { return x < m.x; }
  bool operator<=(const ModInt &m) const { return x <= m.x; }
  bool operator>(const ModInt &m) const { return x > m.x; }
  bool operator>=(const ModInt &m) const { return x >= m.x; }
  explicit operator bool() const { return x; }
  explicit operator uint64() const { return x; }
  ModInt operator^(uint64 y) const {
    uint64 t = x, u = 1;
    while (y) {
      if (y & 1) (u *= t) %= MODULO;
      (t *= t) %= MODULO;
      y >>= 1;
    }
    return make(u);
  }
  friend ostream &operator<<(ostream &os, const ModInt<MODULO> &m) {
    return os << m.x;
  }
  friend istream &operator>>(istream &is, ModInt<MODULO> &m) {
    uint64 y;
    is >> y;
    m = make(y);
    return is;
  }
  static vector<ModInt> fact, finv, invs;
  static void init(uint32 n) {
    uint32 m = fact.size();
    if (n < m) return;
    fact.resize(n + 1, 1);
    finv.resize(n + 1, 1);
    invs.resize(n + 1, 1);
    if (m == 0) m = 1;
    for (uint32 i = m; i <= n; ++i) fact[i] = fact[i - 1] * ModInt(i);
    finv[n] = ModInt(1) / fact[n];
    for (uint32 i = n; i >= m; --i) finv[i - 1] = finv[i] * make(i);
    for (uint32 i = m; i <= n; ++i) invs[i] = finv[i] * fact[i - 1];
  }
  static ModInt C(int64 n, int64 r) {
    if (r == 0) return make(1);
    if (r < 0) return make(0);
    if (n < 0) return make(r & 1 ? MODULO - 1 : 1) * C(-n + r - 1, r);
    if (n == 0 || n < r) return make(0);
    init(n);
    return fact[n] * finv[n - r] * finv[r];
  }
  static ModInt P(int64 n, int64 r) {
    if (n < r || r < 0) return make(0);
    init(n);
    return fact[n] * finv[n - r];
  }
  static ModInt H(int64 n, int64 r) {
    if (n < 0 || r < 0) return make(0);
    if (!n && !r) return make(1);
    init(n + r - 1);
    return C(n + r - 1, r);
  }
  static ModInt montmort(uint32 n) {
    ModInt res;
    init(n);
    for (uint32 k = 2; k <= n; ++k) {
      if (k & 1)
        res -= finv[k];
      else
        res += finv[k];
    }
    return res *= fact[n];
  }
  static ModInt LagrangePolynomial(vector<ModInt> &y, ModInt t) {
    uint32 n = y.size() - 1;
    if (t.x <= n) return y[t.x];
    init(n + 1);
    ModInt res, num(1);
    for (uint32 i = 0; i <= n; ++i) num *= t - make(i);
    for (uint32 i = 0; i <= n; ++i) {
      ModInt tmp = y[i] * num / (t - make(i)) * finv[i] * finv[n - i];
      if ((n - i) & 1)
        res -= tmp;
      else
        res += tmp;
    }
    return res;
  }
};
template <int MODULO>
vector<ModInt<MODULO>> ModInt<MODULO>::fact = vector<ModInt<MODULO>>();
template <int MODULO>
vector<ModInt<MODULO>> ModInt<MODULO>::finv = vector<ModInt<MODULO>>();
template <int MODULO>
vector<ModInt<MODULO>> ModInt<MODULO>::invs = vector<ModInt<MODULO>>();
using modint = ModInt<MOD>;
const int MAX = 20;
signed main() {
  long long N;
  MACRO_VAR_Scan(N);
  ;
  vector<long long> A(N);
  for (auto &i : A) cin >> i;
  ;
  vector<long long> dif;
  for (long long i = long long(0); i < long long(N - 1); ++i)
    dif.emplace_back(A[i + 1] - A[i]);
  ;
  modint::init(MAX + 20);
  vector<modint> stir(1, 0);
  for (long long i = long long(0); i < long long(MAX); ++i) {
    modint tmp1 = i + 1;
    tmp1 *= stir.back();
    modint tmp2 = modint::fact[i];
    stir.emplace_back(tmp1 + tmp2);
  };
  modint res = 0;
  int frm = 2, to = N - 1;
  for (long long i = long long(0); i < long long(N - 1); ++i) {
    modint tmp = modint::fact[to];
    tmp /= modint::fact[frm - 1];
    tmp *= stir[i + 1];
    tmp *= dif[i];
    res += tmp;
    ;
    ++frm;
  }
  print(res);
}
