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;
void codeforces_edu38_A() {
  int n;
  cin >> n;
  char c[n];
  scanf("%s", c);
  int ccc = 0;
  for (int i = 0; i < n; i++) {
    if (c[i] != 'a' && c[i] != 'e' && c[i] != 'i' && c[i] != 'o' &&
        c[i] != 'u' && c[i] != 'y') {
      printf("%c", c[i]);
      ccc = 0;
    } else {
      if (ccc == 0) {
        printf("%c", c[i]);
        ccc = 1;
      }
    }
  }
}
void codeforces_edu38_B() {
  int n;
  cin >> n;
  int a[n];
  int min = 1000000000;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (abs(1000001 - 2 * a[i]) < min) {
      min = abs(1000001 - 2 * a[i]);
    }
  }
  printf("%d", (1000001 - 2 - min) / 2);
}
int isSquare(int x) {
  int t = (int)floor(sqrt((float)x)) - 1;
  if (x == t * t || x == (t + 1) * (t + 1) || x == (t + 2) * (t + 2)) {
    return 1;
  }
  return -1;
}
int findroot(int x) {
  int t = (int)floor(sqrt((float)x)) - 1;
  for (int y = t; y < t + 4; y++) {
    if (x == y * y) {
      return y;
    }
  }
  return 0;
}
void codeforces_edu38_C() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int x;
    cin >> x;
    int nn = -1;
    int mm = -1;
    for (int n = (int)floor(sqrt((float)x)) - 1;
         n <= (int)ceil(sqrt((float)4.0 / 3.0 * (float)x)) + 1; n++) {
      if (isSquare(n * n - x) == 1) {
        int u = findroot(n * n - x);
        if (u != 0) {
          for (int m = n / (u + 1) - 1; m < n / u + 1; m++) {
            if (m != 0) {
              if (n / m == u) {
                nn = n;
                mm = m;
                break;
                break;
              }
            }
          }
        }
      }
    }
    if (nn == -1 && mm == -1) {
      printf("-1\n");
    } else {
      printf("%d %d\n", nn, mm);
    }
  }
}
void codeforces_edu38_D() {}
int power(int a, unsigned int b) {
  if (b == 0) {
    return 1;
  }
  int p;
  p = power(a, b / 2) % (1000000007);
  p = ((long long)p * (long long)p) % ((long long)1000000007);
  return (b % 2 == 0) ? (long long)p
                      : ((long long)a * (long long)p) % (long long)1000000007;
}
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int modInverse(int a, int m) { return power(a, m - 2); }
int compare(const void *a, const void *b) {
  int num1 = *(int *)a;
  int num2 = *(int *)b;
  if (num1 < num2) return -1;
  if (num1 > num2) return 1;
  return 0;
}
int fac(int n, int c) {
  long long res = 1;
  for (int i = 1; i <= n; i++) {
    if (i != n - c) {
      res = (res * i) % 1000000007;
    }
  }
  return (int)res;
}
void codeforces_edu38_E() {
  int n;
  cin >> n;
  long long facn = 1;
  for (int i = 1; i <= n; i++) {
    facn = (facn * i) % 1000000007;
  }
  int a[n];
  int b[n];
  int c[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = 0;
    c[i] = 0;
  }
  qsort(a, sizeof(a) / sizeof(int), sizeof(int), compare);
  int index = 0;
  int current = 0;
  int cn = -1;
  for (int i = 0; i < n; i++) {
    if (current == 0) {
      b[index] = a[i];
      cn = a[i];
      c[index]++;
      current = 1;
    } else {
      if (a[i] == cn) {
        c[index]++;
      } else {
        index++;
        cn = a[i];
        b[index] = a[i];
        c[index]++;
      }
    }
  }
  index++;
  long long ans = 0;
  int sumc = 0;
  for (int i = 0; i < index - 1; i++) {
    ans =
        (ans + ((((long long)(((long long)b[i] * c[i]) % 1000000007) * facn)) %
                1000000007) *
                   power(n - sumc, 1000000007 - 2)) %
        1000000007;
    sumc += c[i];
  }
  printf("%d", (int)ans);
}
void codeforces_edu38_F() {}
void codeforces_edu38_G() {}
int main() {
  codeforces_edu38_E();
  return 0;
}
