#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int mx = 1e6 + 10;
long long da[mx + 10];
long long fac[mx + 10];
long long pre[mx + 10];
multiset<long long> s;
long long qpow(long long a, long long n) {
  long long ans = 1;
  while (n) {
    if (n & 1) ans = ans * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return ans;
}
long long inv(int t) { return qpow(t, mod - 2); }
int main() {
  long long n;
  fac[1] = 1 % mod;
  scanf("%lld", &n);
  for (int i = 1; i <= n; ++i) scanf("%lld", &da[i]), s.insert(da[i]);
  for (int i = 2; i < mx; ++i) fac[i] = fac[i - 1] * i % mod;
  sort(da + 1, da + 1 + n);
  int num = unique(da + 1, da + 1 + n) - (da + 1);
  for (int i = 1; i <= num; ++i) pre[i] = pre[i - 1] + s.count(da[i]);
  long long ans = 0;
  for (int i = 1; i < num; ++i) {
    ans = ans + fac[n] * inv(n - pre[i - 1]) % mod * da[i] % mod *
                    s.count(da[i]) % mod;
    ans %= mod;
  }
  printf("%lld\n", ans);
  return 0;
}
