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;
template <typename T>
istream& operator>>(istream& is, vector<T>& a) {
  for (T& ai : a) is >> ai;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> const& a) {
  os << "[ ";
  for (const T& ai : a) os << ai << " ";
  return os << "]";
}
template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& a) {
  return is >> a.first >> a.second;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2> const& a) {
  return os << "(" << a.first << ", " << a.second << ")";
}
const int M = 1000000007;
int egcd(int a, int b, int& x, int& y) {
  if (a < b) return egcd(b, a, y, x);
  int bx = 0, by = 1, q, r, rx, ry;
  x = 1;
  y = 0;
  while (b) {
    q = a / b;
    r = a % b;
    rx = x - q * bx;
    ry = y - q * by;
    a = b;
    x = bx;
    y = by;
    b = r;
    bx = rx;
    by = ry;
  }
  return a;
}
int mod_inv(int a) {
  int x, y;
  egcd(a, M, x, y);
  if (x < 0) x += M;
  return x;
}
int f() {
  int n, t = 1;
  cin >> n;
  map<int, int> c;
  for (int i = 0, a; i < n; ++i) {
    cin >> a;
    ++c[a];
    t = ((long long)t * (i + 1)) % M;
  }
  int m = n, r = 0;
  for (const auto& ci : c) {
    int k = ci.first, v = ci.second;
    if (m > v) r = (r + ((long long)k * v) % M * mod_inv(m)) % M;
    m -= v;
  }
  return ((long long)r * t) % M;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << f() << "\n";
  return 0;
}
