#include <bits/stdc++.h>
int main(void) {
  int N = 0;
  double sum = 0.0;
  long kN = 1;
  scanf("%d", &N);
  double x[N];
  for (int i = 1; i <= N; i++) {
    scanf("%lf", &x[i - 1]);
    kN = kN * i;
  }
  kN = kN / N;
  for (int j = 1; j < N - 1; j++) {
    for (int k = 0; k < N - j; k++) {
      sum = sum + (1.0 / (double)(N - j)) * x[k + 1];
    }
  }
  kN = (long)((double)kN * sum);
  kN = kN % 1000000007;
  printf("%ld\n", kN);
  return 0;
}
