#include <bits/stdc++.h>
using namespace std;
int n;
long long jie[1000005];
const long long mod = 1e9 + 7;
int a[1000005];
long long mypow(long long a, long long b) {
  long long ret = 1;
  long long c = a % mod;
  while (b) {
    if (b & 1) ret = ret * c % mod;
    c = c * c % mod;
    b /= 2;
  }
  return ret;
}
void init() {
  jie[0] = 1;
  for (int i = 1; i <= n; i++) {
    jie[i] = jie[i - 1] * i % mod;
  }
}
long long ans = 0;
void work(int pre, int num) {
  long long temp = num * jie[n] % mod;
  temp = temp * mypow(n - pre, mod - 2) % mod;
  ans = (ans + temp) % mod;
}
int main() {
  scanf("%d", &n);
  init();
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + n + 1);
  int lim = a[n];
  int pre = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == lim) break;
    if (a[i - 1] == a[i]) {
      work(pre, a[i]);
    } else {
      pre = i - 1;
      work(pre, a[i]);
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
