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.
import java.util.*;
import java.io.*;
public class E {
        String INPUT = "6 1 2 3 3 4 5";
        long MOD = (long)1e9+7;
        void solve()
        {
                int n = i();
                long[] a = new long[n];
                for (int i = 0; i < n; i++) {
                        a[i] = l();
                }
                Merge.sort(a);
                long nfact = 1;
                for (int i = 1; i <=n ; i++) {
                        nfact = nfact*i%MOD;
                       
                }
                long ans = 0;
                for (int i = 0; i < n&& a[i]!=a[n-1];) {
                        int j = i;
                        while(j<n && a[i] == a[j]){ j++;}//out.println( j+" "+ans);
                        ans += nfact*inv(n-i,MOD)%MOD*(j-i)%MOD*a[i]%MOD;
                        ans%=MOD;
                        i = j;
                }
                out.println(ans);
        }
        public static long inv(long N, long M) {
                long x = 0, lastx = 1, y = 1, lasty = 0, q, t, a = N, b = M;
                while (b != 0) {
                        q = a / b;
                        t = a % b;
                        a = b;
                        b = t;
                        t = x;
                        x = lastx - q * x;
                        lastx = t;
                        t = y;
                        y = lasty - q * y;
                        lasty = t;
                }
                return (lastx + M) % M;
        }
        static class Merge
        {

                public static void sort(long inputArr[])
                {
                        int length = inputArr.length;
                        doMergeSort(inputArr,0, length - 1);
                }

                private static void doMergeSort(long[] arr,int lowerIndex, int higherIndex) {
                        if (lowerIndex < higherIndex) {
                                int middle = lowerIndex + (higherIndex - lowerIndex) / 2;
                                doMergeSort(arr,lowerIndex, middle);
                                doMergeSort(arr,middle + 1, higherIndex);
                                mergeParts(arr,lowerIndex, middle, higherIndex);
                        }
                }

                private static void mergeParts(long[]array,int lowerIndex, int middle, int higherIndex)
                {
                        long[] temp=new long[higherIndex-lowerIndex+1];
                        for (int i = lowerIndex; i <= higherIndex; i++) {
                                temp[i-lowerIndex] = array[i];
                        }
                        int i = lowerIndex;
                        int j = middle + 1;
                        int k = lowerIndex;
                        while (i <= middle && j <= higherIndex) {
                                if (temp[i-lowerIndex] < temp[j-lowerIndex])
                                {
                                        array[k] = temp[i-lowerIndex];
                                        i++;
                                }
                                else
                                {
                                        array[k] = temp[j-lowerIndex];
                                        j++;
                                }
                                k++;
                        }
                        while (i <= middle) {
                                array[k] = temp[i-lowerIndex];
                                k++;
                                i++;
                        }
                        while(j<=higherIndex){
                                array[k]=temp[j-lowerIndex];
                                k++;
                                j++;
                        }
                }
        }
        void run() throws Exception{
                is = oj ? System.in: new ByteArrayInputStream(INPUT.getBytes());
                //is = System.in;
                out = new PrintWriter(System.out);
                long s = System.currentTimeMillis();
                solve();
                out.flush();
                tr(System.currentTimeMillis()-s+"ms");
        }
        public static void main(String[] args)throws Exception {
                new E().run();
        }
        InputStream is;
        PrintWriter out;
        private byte[] inbuf = new byte[1024];
        public int lenbuf = 0, ptrbuf = 0;

        private int readByte()
        {
                if(lenbuf == -1)throw new InputMismatchException();
                if(ptrbuf >= lenbuf){
                        ptrbuf = 0;
                        try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
                        if(lenbuf <= 0)return -1;
                }
                return inbuf[ptrbuf++];
        }

        private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
        private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

        private double d() { return Double.parseDouble(s()); }
        private char c() { return (char)skip(); }

        private String s()
        {
                int b = skip();
                StringBuilder sb = new StringBuilder();
                while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
                        sb.appendCodePoint(b);
                        b = readByte();
                }
                return sb.toString();
        }

        private char[] sa(int n)
        {
                char[] buf = new char[n];
                int b = skip(), p = 0;
                while(p < n && !(isSpaceChar(b))){
                        buf[p++] = (char)b;
                        b = readByte();
                }
                return n == p ? buf : Arrays.copyOf(buf, p);
        }

        private char[][] nm(int n, int m)
        {
                char[][] map = new char[n][];
                for(int i = 0;i < n;i++)map[i] = sa(m);
                return map;
        }

        private int[] ia(int n)
        {
                int[] a = new int[n];
                for(int i = 0;i < n;i++)a[i] = i();
                return a;
        }

        private int i()
        {
                int num = 0, b;
                boolean minus = false;
                while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
                if(b == '-'){
                        minus = true;
                        b = readByte();
                }

                while(true){
                        if(b >= '0' && b <= '9'){
                                num = num * 10 + (b - '0');
                        }else{
                                return minus ? -num : num;
                        }
                        b = readByte();
                }
        }

        private long l()
        {
                long num = 0;
                int b;
                boolean minus = false;
                while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
                if(b == '-'){
                        minus = true;
                        b = readByte();
                }

                while(true){
                        if(b >= '0' && b <= '9'){
                                num = num * 10 + (b - '0');
                        }else{
                                return minus ? -num : num;
                        }
                        b = readByte();
                }
        }

        private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
        private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }

}