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.io.*;
import java.util.*;

public class E implements Runnable{
	public static void main (String[] args) {new Thread(null, new E(), "_cf", 1 << 28).start();}

	public void run() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("Go!");

		//combinatorics is weird and hard
		
		int n = fs.nextInt();
		int[] a = fs.nextIntArray(n);
		sort(a);

		long[] invs = new long[n + 1];
		invs[1] = 1;
		for (int i = 2; i < invs.length; ++i) {
			long ret = 0;
			ret = MOD - (MOD / i);
			ret = (ret * invs[((int)(MOD%i))]) % MOD;
			ret %= MOD;
			invs[i] = ret;
		}

		long nfact = 1;
		for(int i = 2; i <= n; i++)
			nfact = mult(nfact, i);
		
		long res = 0;
		for(int i = 0; i < n; i++) {
			int j = i;
			while(j < n && a[i] == a[j]) j++;
			if(j == n) break;
			long num = j - i;
			long den = n - j + num;
			num = mult(num, invs[(int)den]);
			num = mult(num, nfact);
			res = add(res, mult(a[i], num)); 
			i=j-1;
		}
		out.println(res);
		
		out.close();
	}
	
	long sub(long a, long b) {
		a %= MOD;
		b %= MOD;
		a -= b;
		while(a < 0) a += MOD;
		a %= MOD;
		return a;
	}

	long nChoosek(int n, int k, long[] fact) {
		if(n-k < 0) return 0;
		long num = fact[n];
		long den = mult(fact[k], fact[n-k]);
		long inv = power(den, MOD-2);
		return mult(num, inv);
	}
	
	long power (long x, long y) {
    	long res = 1;
    	x %= MOD;
    	while(y > 0) {
    		if(y % 2 == 1) {
    			res = (res * x) % MOD;
    		}
    		y = (y >> 1L);
    		x = (x * x) % MOD;
    	}
    	return res;
    }
	
	long add(long a, long b) {
		a %= MOD;
		b %= MOD;
		a += b;
		a %= MOD;
		return a;
	}
	
	long MOD = (long)1e9+7;
	long mult(long a, long b) {
		a %= MOD; b %= MOD;
		a *= b;
		a %= MOD;
		return a;
	}

	void sort (int[] a) {
		int n = a.length;
		for(int i = 0; i < 50; i++) {
			Random r = new Random();
			int x = r.nextInt(n), y = r.nextInt(n);
			int temp = a[x];
			a[x] = a[y];
			a[y] = temp;
		}
		Arrays.sort(a);
	}

	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}                
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
		
		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) res[i] = nextInt();
			return res;
		}
		
	}

}