#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1010000;
const int MOD = 1e9 + 7;
int n, m, a[MAXN];
long long ksm(long long x, long long y) {
  if (y == 0) return 1;
  if (y == 1) return x;
  long long t = ksm(x, y / 2);
  t = t * t % MOD;
  if (y & 1) t = t * x % MOD;
  return t;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), m = max(m, a[i]);
  sort(a + 1, a + 1 + n);
  long long ans = 0, last = 0, fac = 1;
  for (int i = 2; i <= n; i++) fac = fac * i % MOD;
  for (int i = 1; i <= n; i++) {
    if (m == a[i]) break;
    if (a[i] != a[i - 1]) last = fac * ksm(n - i + 1, MOD - 2) % MOD;
    ans = (ans + last * a[i]) % MOD;
  }
  printf("%lld", ans);
  return 0;
}
