#include <bits/stdc++.h>
using namespace std;
template <class T>
void splitstr(const string &s, vector<T> &out) {
  istringstream in(s);
  out.clear();
  copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
static void redirect(int argc, const char **argv) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  if (argc > 1) {
    static filebuf f;
    f.open(argv[1], ios::in);
    cin.rdbuf(&f);
    if (!cin) {
      cerr << "Failed to open '" << argv[1] << "'" << endl;
      exit(1);
    }
  }
  if (argc > 2) {
    static filebuf f;
    f.open(argv[2], ios::out | ios::trunc);
    cout.rdbuf(&f);
    if (!cout) {
      cerr << "Failed to open '" << argv[2] << "'" << endl;
    }
  }
}
static long long pmod(long long a, long long b) {
  if (b == 0)
    return 1;
  else if (b & 1)
    return pmod(a, b - 1) * a % 1000000007;
  else {
    long long t = pmod(a, b / 2);
    return t * t % 1000000007;
  }
}
static long long inverse(long long a) { return pmod(a, 1000000007 - 2); }
int main(int argc, const char **argv) {
  redirect(argc, argv);
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  sort(begin(a), end(a));
  int p = 0;
  long long ans = 0;
  while (p < N) {
    int q = p + 1;
    while (q < N && a[q] == a[p]) q++;
    if (q == N) break;
    long long s = (q - p) * a[p] % 1000000007;
    s *= inverse(N - p);
    s %= 1000000007;
    ans = (ans + s) % 1000000007;
    p = q;
  }
  for (long long i = 2; i <= N; i++) ans = ans * i % 1000000007;
  cout << ans << '\n';
  return 0;
}
