#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(ll i=(n);i<(k);i++)
#define ALL(a)  (a).begin(),(a).end()
ll ans=0;
const ll MOD = 1000000007;
void Main(){
    ll n;cin>>n;
    vector<ll> c(n);
    For(i,0,n) cin>>c[i];
    sort(ALL(c));
    reverse(ALL(c));
    ll N4=1;
    For(i,0,n-1) N4=N4*4%MOD;
    For(i,0,n){
         ans+=(i+2)*c[i]%MOD;
         ans%=MOD;
    }
    ans*=N4;
    ans%=MOD;
    cout<<ans<<endl;
}
int main(){
     Main();
     return 0;
}