For two sequences S and T of length N consisting of 0 and 1, let us define f(S, T) as follows:

* Consider repeating the following operation on S so that S will be equal to T. f(S, T) is the minimum possible total cost of those operations.

* Change S_i (from 0 to 1 or vice versa). The cost of this operation is D \times C_i, where D is the number of integers j such that S_j \neq T_j (1 \leq j \leq N) just before this change.



There are 2^N \times (2^N - 1) pairs (S, T) of different sequences of length N consisting of 0 and 1. Compute the sum of f(S, T) over all of those pairs, modulo (10^9+7).

Constraints

* 1 \leq N \leq 2 \times 10^5
* 1 \leq C_i \leq 10^9
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N
C_1 C_2 \cdots C_N


Output

Print the sum of f(S, T), modulo (10^9+7).

Examples

Input

1
1000000000


Output

999999993


Input

2
5 8


Output

124


Input

5
52 67 72 25 79


Output

269312
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
long mod=1e9+7;
long N;
long c[2<<17];
long F[2<<17],I[2<<17];
long power(long a,long b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}
long C(long a,long b){return F[a]*I[b]%mod*I[a-b]%mod;}
int main()
{
	cin>>N;
	F[0]=1;
	for(long i=1;i<=N;i++)F[i]=F[i-1]*i%mod;
	I[N]=power(F[N],mod-2);
	for(long i=N-1;i>=0;i--)I[i]=I[i+1]*(i+1)%mod;
	for(int i=0;i<N;i++)
	{
		cin>>c[i];
	}
	sort(c,c+N);
	long N2=power(2,N);
	long ans=0;
	for(int i=0;i<N;i++)
	{
		long now=(N-i-1)*power(2,N-i-2)+power(2,N-i-1);
		now%=mod;
		ans+=N2*c[i]%mod*now%mod;
		N2=N2*2%mod;
	}
	cout<<ans%mod<<endl;
}