#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7, M = 2e5 + 100;
void Solution();
int n;
long long int seq[M * 5];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  Solution();
  return 0;
}
long long int ppow(long long int base, long long int exp) {
  if (exp == 0) return 1;
  long long int r = ppow(base, exp / 2);
  r *= r;
  r %= mod;
  if (exp % 2) r *= base;
  return r % mod;
}
inline void Solution() {
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> seq[i];
  }
  long long int fn = 1;
  for (long long int i = 2; i < n + 1; i++) {
    fn = fn * (i);
    fn %= mod;
  }
  sort(seq, seq + n);
  long long int ans = 0;
  long long int mx = max_element(seq, seq + n) - seq;
  for (long long int i = 0; i < mx; i++) {
    long long int s = lower_bound(seq, seq + n, seq[i]) - seq;
    long long int sinv = ppow(n - s, mod - 2);
    ans = (ans + ((fn * sinv) % mod) * seq[i]) % mod;
  }
  cout << ans << endl;
}
