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>
template <std::uint32_t mod>
class modint {
 private:
  std::uint32_t n;

 public:
  modint() : n(0){};
  modint(std::uint64_t n_) : n(n_ % mod){};
  bool operator==(const modint& m) const { return n == m.n; }
  bool operator!=(const modint& m) const { return n != m.n; }
  std::uint32_t get() const { return n; }
  modint& operator+=(const modint& m) {
    n += m.n;
    n = (n < mod ? n : n - mod);
    return *this;
  }
  modint& operator-=(const modint& m) {
    n += mod - m.n;
    n = (n < mod ? n : n - mod);
    return *this;
  }
  modint& operator*=(const modint& m) {
    n = std::uint64_t(n) * m.n % mod;
    return *this;
  }
  modint operator+(const modint& m) const { return modint(*this) += m; }
  modint operator-(const modint& m) const { return modint(*this) -= m; }
  modint operator*(const modint& m) const { return modint(*this) *= m; }
  modint binpow(std::uint64_t b) const {
    modint ans = 1, m = modint(*this);
    while (b) {
      if (b & 1) ans *= m;
      m *= m;
      b >>= 1;
    }
    return ans;
  }
  modint inv() { return (*this).binpow(mod - 2); }
};
using namespace std;
using modulo = modint<1000000007>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a.begin(), a.end());
  modulo ans = 0;
  for (int i = 0; i < n; ++i) {
    if (a[i] == a[n - 1]) continue;
    int ptr = lower_bound(a.begin(), a.end(), a[i]) - a.begin();
    ans += modulo(n - ptr).inv() * a[i];
  }
  for (int i = 1; i <= n; ++i) {
    ans *= i;
  }
  cout << ans.get() << endl;
  return 0;
}
