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;
long long F = 1e9 + 7;
long long mul(long long a, long long b) { return (a * b) % F; }
long long add(long long a, long long b) { return (a + b) % F; }
long long sub(long long a, long long b) { return ((a - b) % F + F) % F; }
void upd(long long &a, long long b) { a = (a % F + b % F) % F; }
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long pow2(long long a, int b, long long p = F) {
  if (b == 0) return 1 % p;
  if (b == 1) return a % p;
  long long c = pow2(a, b / 2, p) % p;
  c = c * c % p;
  if (b & 1) c = c * a % p;
  return c % p;
}
long long inv(long long a, long long p = F) { return pow2(a, p - 2, p); }
long long jie[(1234567)], inj[(1234567)], a[(1234567)], iv[(1234567)];
long long C(long long a, long long b) {
  return jie[a] * inj[b] % F * inj[a - b] % F;
}
int main() {
  int n = 1000000 + 100;
  for (int i = 1; i <= n; i++) a[i] = i;
  jie[0] = 1;
  for (int i = 1; i <= n; i++) jie[i] = jie[i - 1] * i % F;
  inj[n] = inv(jie[n]);
  for (int i = n - 1; i; i--) inj[i] = inj[i + 1] * (i + 1) % F;
  inj[0] = 1;
  iv[0] = 1;
  for (int i = 1; i <= n; i++) iv[i] = inj[i] * jie[i - 1] % F;
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  sort(a + 1, a + 1 + n);
  long long c = 0, p = 0;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    int j = i;
    while (j < n && a[j + 1] == a[i]) ++j;
    int pr = i - 1, nx = n - j;
    if (!nx) break;
    long long t = jie[nx + j - i] * (j - i + 1) % F;
    long long t2 = j - i + nx + 1 + 1;
    if (t2 <= n) t = t * jie[n] % F * inj[t2 - 1] % F;
    ans = (ans + t * a[i] % F) % F;
    i = j;
  }
  cout << ans;
  return 0;
}
