#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  long long _X[100000], X[100000];
  cin >> N;
  for (int i = 0; i < (N); ++i) {
    cin >> _X[i];
  }
  for (int i = 0; i < (N); ++i) {
    X[i] = _X[N - 1] - _X[N - 1 - i];
  }
  long long kaijo[100001], rkaijo[100001];
  kaijo[0] = 1;
  rkaijo[N] = 1;
  for (int i = 0; i < (N); ++i) {
    kaijo[i + 1] = kaijo[i] * (i + 1) % 1000000007;
    rkaijo[N - i - 1] = rkaijo[N - i] * (N - i - 1) % 1000000007;
  }
  for (int i = 0; i < (N); ++i) {
  }
  long long ret = 0;
  for (int i = 1; i < N; ++i) {
    long long coff = kaijo[N - i - 1] * rkaijo[N - i + 1];
    ret = (ret + X[i] * coff) % 1000000007;
  }
  cout << ret << endl;
}
