You are given an array a of length n. We define fa the following way:

  * Initially fa = 0, M = 1; 
  * for every 2 ≤ i ≤ n if aM < ai then we set fa = fa + aM and then set M = i. 



Calculate the sum of fa over all n! permutations of the array a modulo 109 + 7.

Note: two elements are considered different if their indices differ, so for every array a there are exactly n! permutations.

Input

The first line contains integer n (1 ≤ n ≤ 1 000 000) — the size of array a.

Second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109).

Output

Print the only integer, the sum of fa over all n! permutations of the array a modulo 109 + 7.

Examples

Input

2
1 3


Output

1

Input

3
1 1 2


Output

4

Note

For the second example all the permutations are:

  * p = [1, 2, 3] : fa is equal to 1; 
  * p = [1, 3, 2] : fa is equal to 1; 
  * p = [2, 1, 3] : fa is equal to 1; 
  * p = [2, 3, 1] : fa is equal to 1; 
  * p = [3, 1, 2] : fa is equal to 0; 
  * p = [3, 2, 1] : fa is equal to 0. 



Where p is the array of the indices of initial array a. The sum of fa is equal to 4.
#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const long long linf = (long long)1e18;
const int mod = (int)1e9 + 7;
const long double eps = (long double)1e-8;
const int maxn = (int)1e6 + 5;
const int MX = (int)1e6;
const long double pi = acos(-1);
long long f[maxn], of[maxn], p2[maxn], a[maxn];
int n;
long long pw(long long x, long long y) {
  if (y == 0) return 1;
  if (y & 1) return x * pw(x, y - 1) % mod;
  x = pw(x, y / 2);
  return x * x % mod;
}
void init() {
  f[0] = 1;
  of[0] = 1;
  for (auto i = 1; i <= MX; ++i) {
    f[i] = f[i - 1] * (long long)i % mod;
    of[i] = pw(f[i], mod - 2);
  }
  p2[0] = 1;
  for (auto i = 1; i <= MX; ++i) p2[i] = p2[i - 1] * 2ll % mod;
}
long long solve() {
  sort(a, a + n);
  int k = 0;
  long long ans = 0;
  for (auto i = 0; i < n; ++i) {
    if (a[i] == a[n - 1]) break;
    if (i != 0 && a[i] != a[i - 1]) k = i;
    ans =
        (ans + (long long)a[i] * f[n] % mod * pw((n - k), mod - 2) % mod) % mod;
  }
  return ans;
}
int p[maxn];
long long stupid_solve() {
  for (auto i = 0; i < n; ++i) {
    p[i] = i;
  }
  long long ans = 0;
  int k = 0;
  do {
    ++k;
    long long j = 0;
    for (auto i = 1; i < n; ++i) {
      if (a[p[i]] > a[p[j]]) {
        ans += a[p[j]];
        j = i;
      }
    }
  } while (next_permutation(p, p + n));
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  srand(time(0));
  init();
  cin >> n;
  for (auto i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << solve() << endl;
  exit(0);
  int tests = 10000;
  for (auto numt = 0; numt < tests; ++numt) {
    n = rand() % 10 + 1;
    for (auto i = 0; i < n; ++i) a[i] = rand() % 10 + 1;
    long long s0 = solve(), s1 = stupid_solve();
    if (s0 != s1) {
      cout << "FAIL" << endl;
      cout << numt << endl;
      cout << s0 << endl;
      cout << s1 << endl;
      cout << n << endl;
      for (auto i = 0; i < n; ++i) {
        cout << a[i] << " ";
      }
      cout << endl;
      exit(0);
    }
  }
  return 0;
}
