#include <bits/stdc++.h>
using namespace std;
using pii = pair<long long, long long>;
using vi = vector<long long>;
const long long MX = 1e5 + 5, INF = 5LL << 57, MOD = 1e9 + 7;
long long N, M;
string S;
vi va, vb;
void input() {
  ;
  ;
  cin >> N;
  va.resize(N);
  for (long long i = (long long)(0); i <= (long long)(N - 1); ++i) {
    cin >> va[i];
  }
}
long long facts[MX];
long long dp[MX];
long long facsum[MX + 1];
void solve() {
  vi a(N - 1);
  facts[1] = 1;
  facsum[1] = 1;
  facsum[2] = 3;
  for (long long i = (long long)(2); i <= (long long)(MX - 1); ++i) {
    facts[i] = facts[i - 1] * i % MOD;
  }
  for (long long i = (long long)(0); i <= (long long)(N - 2); ++i) {
    a[i] = va[i + 1] - va[i];
  }
  for (long long i = (long long)(3); i <= (long long)(MX - 1); ++i) {
    facsum[i] = facsum[i - 1] + facts[i];
    facsum[i] %= MOD;
  }
  dp[1] = a[0];
  for (long long i = (long long)(2); i <= (long long)(N - 1); ++i) {
    dp[i] = dp[i - 1] * i % MOD + facsum[i - 1] * a[i - 1] % MOD;
    dp[i] %= MOD;
  }
  cout << dp[N - 1] << endl;
  ;
  ;
}
signed main() {
  input();
  solve();
  return 0;
}
