#include <bits/stdc++.h>
using namespace std;
const int maxi = 1e5 + 7;
const int P = 1e9 + 7;
int s[maxi], N, minu[maxi];
int main() {
  cin >> N;
  for (int i = 1; i <= N; ++i) cin >> s[i];
  for (int i = 1; i < N; ++i) minu[i] = s[i + 1] - s[1] + minu[i - 1];
  long long x = N - 1;
  long double ans = (s[N] - s[1]) / (N - 1);
  for (int i = 2; i < N; ++i) {
    x *= N - i;
    ans += (long double)(i * (s[N] - s[1]) - minu[i - 1]) / (N - i) / i;
    ans = fmod(ans, P);
  }
  long long pow = 1;
  for (int i = 2; i < N; ++i) pow = pow * i % P;
  ans = fmod(ans * pow, P);
  cout << ans;
  return 0;
}
