#include <bits/stdc++.h>
const double Pi = acos(-1.0);
using namespace std;
const int maxN = 1000005;
const long long mod = 1000000007;
int n;
long long a[maxN];
long long exp(long long x, long long p) {
  if (!p) return 1;
  if (p & 1) return (x * exp(x, p - 1)) % mod;
  return exp((x * x) % mod, p >> 1);
}
int main(int argc, char** argv) {
  scanf("%d", &n);
  long long fact = 1;
  for (long long i = 1; i <= n; i++) fact = (fact * i) % mod;
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  sort(a, a + n);
  long long ans = 0;
  for (int i = 0, j = 0; i < n - 1; i = j) {
    if (a[i] == a[n - 1]) break;
    long long tmp = (a[i] * ((fact * exp(n - i, mod - 2)) % mod)) % mod;
    while (a[j] == a[i]) {
      ans = (ans + tmp) % mod;
      j++;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
