#include <bits/stdc++.h>
using namespace std;
long long n, a[1000200], b[1000200], r, k, ans, p, m;
long long pow_(long long x, long long y) {
  long long tmp = 1;
  while (y) {
    if (y & 1) tmp = tmp * x % 1000000007;
    x = x * x % 1000000007;
    y >>= 1;
  }
  return tmp;
}
int main() {
  scanf("%d", &n);
  m = n;
  ans = 0;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  r = 1;
  b[1] = 0;
  for (int i = 1; i < n; i++)
    if (a[i] == a[i - 1])
      b[i] = b[i - 1], r++;
    else
      b[i] = b[i - 1] + r, r = 1;
  p = 1;
  for (int i = 1; i <= n; i++) p = p * i % 1000000007;
  while (n > 1 && a[n - 2] == a[n - 1]) n--;
  for (int i = 0; i < n - 1; i++)
    ans = (ans + p * pow_(m - b[i], 1000000007 - 2) % 1000000007 * a[i] %
                     1000000007) %
          1000000007;
  cout << ans << endl;
}
