#include <bits/stdc++.h>
using namespace std;
long long n, m, a[100001], f[100001], inv[100001], cnt, ans;
long long line(int x) {
  int tmp = 1;
  for (int i = 2; i <= x; i++) tmp *= i, tmp %= 1000000007;
  return tmp % 1000000007;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  inv[1] = 1;
  for (int i = 2; i < n; i++) {
    inv[i] = (1000000007 - 1000000007 / i) * inv[1000000007 % i] % 1000000007;
  }
  for (int i = 1; i < n; i++) {
    f[i] = ((1 * inv[i] * (1 + f[i - 1])) % 1000000007 +
            ((i - 1) * inv[i] * f[i - 1]) % 1000000007) %
           1000000007;
  }
  for (int i = 2; i <= n; i++) {
    ans = (ans + (f[i - 1] * (a[i] - a[i - 1]) % 1000000007) % 1000000007) %
          1000000007;
  }
  ans *= line(n - 1);
  cout << ans % 1000000007;
}
