#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const long long MAXN = 1e6 + 7;
const double EPS = 1e-8;
long long power(long long a, long long k) {
  if (!k) {
    return 1;
  }
  long long b = power(a, k / 2);
  b = b * b % INF;
  if (k % 2) {
    return a * b % INF;
  } else {
    return b;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  vector<long long> f(MAXN, 1);
  for (long long i = 1; i < MAXN; i++) {
    f[i] = f[i - 1] * i % INF;
  }
  long long n;
  cin >> n;
  map<long long, long long> cnt;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    x = -x;
    cnt[x]++;
  }
  long long all = 0;
  long long res = 0;
  for (auto p : cnt) {
    long long v = -p.first, c = p.second;
    all += c;
    if (all > c) {
      res = (res + c * v % INF * power(all, INF - 2)) % INF;
    }
  }
  cout << res * f[n] % INF;
}
