#include <bits/stdc++.h>
using namespace std;
void getDiffSumRec(vector<unsigned long long int> pPosition,
                   unsigned long long int *pSum,
                   unsigned long long int *pCount) {
  if (pPosition.size() == 0) {
    (*pCount) += 1;
    return;
  }
  for (int i = 0; i < pPosition.size() - 1; i++) {
    (*pSum) += (pPosition[i + 1] - pPosition[i]);
    vector<unsigned long long int> tmp = pPosition;
    tmp.erase(tmp.begin() + i);
    vector<unsigned long long int> tmpPosition = pPosition;
    tmpPosition.erase(tmpPosition.begin() + i);
    getDiffSumRec(tmpPosition, pSum, pCount);
  }
}
int main() {
  int n;
  cin >> n;
  assert(n >= 1 && n <= pow(10, 5));
  vector<unsigned long long int> position;
  for (int i = 0; i < n; i++) {
    unsigned long long int x;
    cin >> x;
    assert(x >= 1 && x <= pow(10, 9));
    position.push_back(x);
  }
  int ans = 0;
  if (0) {
    for (auto item : position) {
      cout << item << endl;
    }
  }
  unsigned long long int count = 0;
  unsigned long long int diffSum = 0;
  for (int i = 0; i < n - 1; i++) {
    diffSum += (position[i + 1] - position[i]);
    count += 1;
    vector<unsigned long long int> tmpPosition = position;
    tmpPosition.erase(tmpPosition.begin() + i);
    getDiffSumRec(tmpPosition, &diffSum, &count);
  }
  double expected = double(diffSum) / count;
  if (0) cout << count << " " << diffSum << " " << expected << endl;
  unsigned long long int divisor = pow(10, 9) - 7;
  unsigned long long int factorial = 1;
  for (unsigned long long int i = 2; i <= n - 1; i++) {
    factorial *= i;
  }
  cout << unsigned long long int(expected * factorial) % divisor << endl;
  return 0;
}
