#include <bits/stdc++.h>
using namespace std;
const double g = 10.0, eps = 1e-12;
const int N = 2000000 + 10, maxn = 1000000 + 10, inf = 0x3f3f3f3f,
          INF = 0x3f3f3f3f3f3f3f3f;
long long f[N], a[maxn];
void init() {
  f[0] = 1;
  for (long long i = 1; i < N; i++) f[i] = f[i - 1] * i % 1000000007;
}
long long quick(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % 1000000007;
    a = a * a % 1000000007;
    b >>= 1;
  }
  return ans;
}
int main() {
  init();
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  sort(a, a + n);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long pre = lower_bound(a, a + n, a[i]) - a;
    long long suf = n - pre - 1;
    if (a[i] == a[n - 1]) continue;
    ans = (ans + f[n] * quick(suf + 1, 1000000007 - 2) % 1000000007 * a[i]) %
          1000000007;
  }
  printf("%lld\n", ans);
  return 0;
}
