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;
auto clk = clock();
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
template <typename T>
inline T gcd(T a, T b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
template <typename T>
inline T lcm(T a, T b) {
  return (a * b) / gcd(a, b);
}
template <typename T>
string toStr(T x) {
  stringstream st;
  st << x;
  string s;
  st >> s;
  return s;
}
template <class T>
void splitStr(const string &s, vector<T> &out) {
  istringstream in(s);
  out.clear();
  copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
inline int two(int n) { return 1 << n; }
inline int isOnBit(int n, int b) { return (n >> b) & 1; }
inline void onBit(int &n, int b) { n |= two(b); }
inline void offBit(int &n, int b) { n &= ~two(b); }
inline int lastBit(int n) { return n & (-n); }
inline int cntBit(int n) {
  int res = 0;
  while (n && ++res) n -= n & (-n);
  return res;
}
const int dx4[] = {-1, 0, 1, 0};
const int dy4[] = {0, 1, 0, -1};
const int dx8[] = {-1, 0, 1, 0, -1, -1, 1, 1};
const int dy8[] = {0, 1, 0, -1, -1, 1, -1, 1};
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long modexp(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long f[1000005];
long long inv[1000005];
void pre() {
  f[0] = 1;
  for (long long i = 1; i <= 1000004; i++) f[i] = (f[i - 1] * i) % 1000000007;
  inv[1000004] = modexp(f[1000004], 1000000007 - 2, 1000000007);
  for (long long i = 1000003; i >= 0; i--)
    inv[i] = ((i + 1) * inv[i + 1]) % 1000000007;
}
long long ncr(long long n, long long r) {
  return (((f[n] * inv[n - r]) % 1000000007) * inv[r]) % 1000000007;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed;
  cout << setprecision(9);
  long long n;
  cin >> n;
  f[0] = 1;
  pre();
  map<long long, long long> m;
  vector<long long> v;
  for (long long i = 0, _n = (n); i < _n; i++) {
    long long x;
    cin >> x;
    m[x] = 0;
    v.push_back(x);
  }
  long long ans = 0;
  sort(v.begin(), v.end());
  long long lar = v[n - 1];
  for (long long i = 0, _n = (n); i < _n; i++) {
    long long s = i - m[v[i]];
    long long l = n - i - 1 + m[v[i]];
    if (v[i] == lar) {
      break;
    }
    long long k = (ncr(n, l + 1));
    long long k1 = (f[l] % 1000000007 * f[s] % 1000000007) % 1000000007;
    long long k2 = v[i] % 1000000007;
    long long zz = (k * k1) % 1000000007;
    zz = (zz * k2) % 1000000007;
    ans = (ans + zz) % 1000000007;
    m[v[i]]++;
  }
  cout << ans % 1000000007;
  return 0;
}
