#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
bool prime(long long x) {
  for (long long i = 2; i <= sqrt(x); i++) {
    if (x % i == 0) return false;
  }
  return true;
}
long long kai(long long x, long long y) {
  long long res = 1;
  for (long long i = x - y + 1; i <= x; i++) {
    res *= i;
    res %= 1000000007;
  }
  return res;
}
long long mod_pow(long long x, long long y, long long m) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) {
      res = res * x % m;
    }
    x = x * x % m;
    y >>= 1;
  }
  return res;
}
long long comb(long long x, long long y) {
  if (y > x) return 0;
  return kai(x, y) * mod_pow(kai(y, y), 1000000007 - 2, 1000000007) %
         1000000007;
}
long long n, x[100000];
long long cnt[100010];
long long cnt2[100010];
long long ans;
signed main() {
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> x[i];
  cnt[1] = kai(n - 1, n - 1);
  cnt2[1] = 1;
  for (long long i = 2; i < n; i++) {
    cnt2[i] =
        (((cnt2[i - 1] * i) % 1000000007) + kai(i - 1, i - 1)) % 1000000007;
    cnt[i] = cnt2[i] * kai(n - 1, n - 1 - i) % 1000000007;
  }
  for (long long i = 1; i < n; i++) {
    ans += (x[i] - x[i - 1]) * cnt[i];
    ans %= 1000000007;
  }
  cout << ans << endl;
}
