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;
static inline void canhazfast() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
template <typename T>
T gcd(T a, T b) {
  return b == 0 ? a : gcd(b, a % b);
}
template <typename T>
T extgcd(T a, T b, T &x, T &y) {
  T x0 = 1, y0 = 0;
  T x1 = 0, y1 = 1;
  while (b) {
    T q = a / b;
    a %= b;
    swap(a, b);
    x0 -= q * x1;
    swap(x0, x1);
    y0 -= q * y1;
    swap(y0, y1);
  }
  x = x0;
  y = y0;
  return a;
}
unsigned long long modinv(unsigned long long n) {
  unsigned long long y0 = 0, y1 = 1;
  unsigned long long a = 1000000007;
  while (n) {
    unsigned long long q = a / n;
    a %= n;
    swap(a, n);
    y0 += 1000000007 - q * y1 % 1000000007;
    if (y0 >= 1000000007) y0 -= 1000000007;
    swap(y0, y1);
  }
  return y0;
}
unsigned f(const unsigned a[], const int ids[], unsigned p[], int n) {
  unsigned long long res = 0;
  int m = 0;
  for (int i = 1; i < n; ++i) {
    if (a[ids[m]] < a[ids[i]]) {
      res += a[ids[m]];
      p[ids[m]] = (p[ids[m]] + 1) % 1000000007;
      m = i;
    }
  }
  return res % 1000000007;
}
unsigned fsum_brute(const unsigned a[], unsigned p[], int n) {
  static int ids[1000000];
  unsigned long long res = 0;
  for (int i = 0; i < n; ++i) ids[i] = i;
  do {
    res += f(a, ids, p, n);
  } while (next_permutation(ids, ids + n));
  return res % 1000000007;
}
int main() {
  static unsigned a[1000000];
  int n, l = 0;
  unsigned ans = 0;
  unsigned long long fn = 1;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%u", a + i);
  sort(a, a + n);
  for (int i = 2; i <= n; ++i) fn = (unsigned long long)i * fn % 1000000007;
  for (int i = 0; i < n; ++i) {
    unsigned long long p;
    if (a[i] == a[n - 1]) break;
    while (a[l] < a[i]) ++l;
    p = fn * modinv(n - l) % 1000000007;
    ans += a[i] * p % 1000000007;
    if (ans >= 1000000007) ans -= 1000000007;
  }
  printf("%u\n", ans);
  return 0;
}
