#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N=200005,Mod=1e9+7;
int a[N];
inline int qpow(int a,int b){
	int ans=1;
	while (b){
		if (b&1) ans=1ll*ans*a%Mod;
		a=1ll*a*a%Mod,b>>=1;
	}
	return ans;
}
int main (){
	int n;scanf ("%d",&n);
	for (int i=1;i<=n;i++) scanf ("%d",&a[i]);
	sort(a+1,a+n+1);int ans=0,all=1ll*qpow(2,n)*qpow(2,n)%Mod;
	int inv2=qpow(2,Mod-2);all=1ll*all*inv2%Mod;
	for (int i=1;i<=n;i++)
		ans=(ans+1ll*all*(n-i+2)%Mod*inv2%Mod*a[i])%Mod;
	printf ("%d",ans);
	return 0;
}