#include <bits/stdc++.h>
using namespace std;
template <class T>
inline int out(const T &t) {
  print(t);
  putchar('\n');
  return 0;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return (gcd(b, a % b));
}
template <class T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
const long long INF = 1e18;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const long long MOD = 1000000007;
void solve(long long N, std::vector<long long> x) {
  double cnt = 0;
  for (long long i = 0; i < N - 1; i++) {
    cnt += (x[N - 1] - x[i]) * 1.0 / (i + 1);
  }
  for (long long i = 1; i < N; i++) {
    cnt *= i;
  }
  cnt = (long long)cnt % MOD;
  cout << (long long)cnt << "\n";
}
int main() {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> x(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &x[i]);
  }
  solve(N, std::move(x));
  return 0;
}
