#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1000000007LL;
void gcd(ll a, ll b, ll &d, ll &x, ll &y) {
  if (b == 0) {
    d = a;
    x = 1;
    y = 0;
    return;
  }
  gcd(b, a % b, d, y, x);
  y -= x * (a / b);
  return;
}
ll inverse(ll a, ll n) {
  ll d, x, y;
  gcd(a, n, d, x, y);
  return d == 1 ? (x + n) % n : -1;
}
int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<ll> d(n - 1);
  for (ll i = 0; i < n - 1; i++) {
    d[i] = a[i + 1] - a[i];
  }
  ll factorial = 1;
  ll ans = 0;
  for (ll i = 0; i < n - 1; i++) {
    factorial = (factorial * (i + 1LL)) % mod;
  }
  for (ll i = 0; i < n - 1; i++) {
    ll count = n - 1 - i;
    ans += (factorial * count) % mod;
    factorial = (factorial * inverse(i + 2, mod)) % mod;
  }
  cout << ans << endl;
  return 0;
}
