#include <bits/stdc++.h>
using namespace std;
long long abs(long long a, long long b) { return max(a, b) - min(a, b); }
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long a, c = 0, w = 1;
  long long b[1000000];
  double q;
  cin >> a;
  for (long long i = 0; i < a; i++) {
    cin >> b[i];
  }
  for (long long i = a; i > 1; i--) {
    c = (c + i) % 1000000007;
  }
  q = (double)c / (a - 1);
  for (long long i = 1; i < a; i++) {
    w = (w * i) % 1000000007;
  }
  cout << (long long)(q * w) % 1000000007 << "\n";
}
