#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long val[n + 1];
  long long dis[n];
  for (int i = 1; i <= n; i++) {
    cin >> val[i];
  }
  for (int i = 1; i <= n - 1; i++) {
    dis[i] = val[i + 1] - val[i];
  }
  long long ans = 0;
  long long kai[n + 2];
  kai[1] = 1;
  kai[2] = 2;
  for (int i = 3; i <= n + 1; i++) {
    long long p = i;
    kai[i] = 0;
    kai[i] = kai[i - 1] * p;
    kai[i] %= 1000000007;
  }
  long long ba[n + 1];
  long long wa[n + 1];
  long long mae[n + 1];
  for (int i = 0; i <= n; i++) {
    ba[i] = 0;
    wa[i] = 0;
    mae[i] = 0;
  }
  ba[1] = kai[n - 1];
  ba[1] %= 1000000007;
  mae[1] = ba[1];
  wa[1] = ba[1];
  ba[2] = 3 * kai[n - 1] / 2;
  ba[2] %= 1000000007;
  mae[2] = ba[2] * 2;
  mae[2] %= 1000000007;
  wa[2] = wa[1] + ba[2];
  wa[2] %= 1000000007;
  for (int i = 3; i <= n - 1; i++) {
    long long p = i;
    ba[i] = wa[i - 1] / p + kai[n - 1];
    ba[i] %= 1000000007;
    mae[i] = kai[i] * p;
    mae[i] %= 1000000007;
    wa[i] = wa[i - 1] + ba[i];
    wa[i] %= 1000000007;
  }
  for (int i = 1; i <= n - 1; i++) {
    ans += ba[i] * dis[i];
    ans %= 1000000007;
  }
  cout << ans << endl;
}
