#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
map<int, int> mp;
long long pw(long long a, int n) {
  long long ret = 1;
  while (n) {
    if (n & 1) ret = ret * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return ret;
}
int main() {
  int n;
  scanf("%d", &n);
  int mx = 0;
  long long fac = 1;
  for (int i = 1; i <= n; i++) {
    fac = fac * i % mod;
    int x;
    scanf("%d", &x);
    mx = max(mx, x);
    mp[x]++;
  }
  int cnt = 0;
  long long ans = 0;
  for (auto p : mp) {
    if (p.first == mx) break;
    ans = (ans +
           p.first * p.second % mod * fac % mod * pw(n - cnt, mod - 2) % mod) %
          mod;
    cnt += p.second;
  }
  printf("%lld\n", ans);
  return 0;
}
