#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0;
  scanf("%d", &n);
  int x[n];
  for (int i = 0; i < n; i++) scanf("%d", &x[i]);
  long long int mod = int(pow(10, 9)) + 7;
  double pre = 1.0 / (n - 1);
  double sum = 0.0;
  for (int i = 0; i < n - 1; i++) {
    sum += x[i + 1] * pre;
  }
  int tmp = 1;
  for (int i = 1; i < n; i++) {
    tmp = tmp * i;
  }
  int ans = 0;
  if (sum * tmp < mod)
    cout << int(sum * tmp) << endl;
  else
    cout << int(sum * tmp) % mod << endl;
  return 0;
}
