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;
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << '\t';
  err(++it, args...);
}
const int maxn = 1e6 + 10, mod = 1e9 + 7;
long long int fact[maxn], inv[maxn], invFact[maxn], a[maxn];
long long int ncr(int n, int r) {
  if (n < 0 || r < 0) return 0;
  if (n == 0) return 1;
  long long int v = (invFact[r] * invFact[n - r]) % mod;
  return (v * fact[n]) % mod;
}
void pre() {
  fact[0] = fact[1] = 1;
  int i;
  for (i = 2; i < maxn - 1; i++) fact[i] = (fact[i - 1] * i) % mod;
  inv[0] = 0;
  inv[1] = 1;
  for (i = 2; i < maxn; i++) {
    inv[i] = mod - ((long long int)(mod / i) * inv[mod % i] % mod);
  }
  invFact[0] = 1;
  for (i = 1; i < maxn; i++) {
    invFact[i] = (inv[i] * invFact[i - 1] % mod);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, m, i, j, k, u, v, ans = 0;
  cin >> n;
  for (i = 1; i < n + 1; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  pre();
  u = 0;
  for (i = 1; i <= n;) {
    for (j = i; j <= n && a[i] == a[j]; j++) {
    }
    if (j <= n) {
      v = (fact[i - 1] * fact[n - i]) % mod;
      v = (v * ncr(n, i - 1)) % mod;
      v = (v * (j - i)) % mod;
      v = (v * a[i]) % mod;
      ans = (ans + v) % mod;
      if (ans < 0) ans += mod;
    }
    i = j;
  }
  cout << ans;
  return 0;
}
