#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;
  }
  double tmp = sum;
  for (int i = n - 1; i >= 1; i--) {
    tmp = fmod(tmp * i, mod);
  }
  cout << double(tmp) << endl;
  return 0;
}
