#include <iostream>
#include <algorithm>
using namespace std;
int c[200000];
const long long p = 1000000007;

long long powmod(long long b, long long x){
    long long t = 1;
    while(x){
        if (x & 1) t = (t * b) % p;
        b = (b * b) % p;
        x >>= 1;
    }
    return t;
}

int main(){
    int n;
    cin >> n;
    long long ans = 0;
    for (int i = 0; i < n; i++) cin >> c[i];
    sort(c, c + n);
    for (int i = 0; i < n; i++) ans = (ans + (n+1-i) * ((long long) c[i])) % p;
    ans = (powmod(4, n-1) * ans) % p;
    cout << ans << '\n';
}
