#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <utility>
#include <iomanip>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7;
ll c[200000];
ll beki2[400001];
int main()
{
	int n;
	ll ans=0;
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>c[i];
	sort(c,c+n);
	beki2[0]=1;
	for(int i=1;i<400001;i++)
	{
		beki2[i]=beki2[i-1]*2LL;
		beki2[i]%=MOD;
	}
	for(int i=0;i<n;i++)
	{
		ll tmp=beki2[2*n-2]*(ll)(n-i+1);
		tmp%=MOD;
		//cerr<<tmp<<endl;
		tmp*=c[i];
		tmp%=MOD;
		ans+=tmp;
		ans%=MOD;
	}
	if(ans<0)
		ans+=MOD;
	cout<<ans<<endl;
	return 0;
}