#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
using Graph = vector<vector<int>>;
ll mod = 1000000007;

int main()
{
    ll n;
    cin >> n;
    vector<ll> c(n);
    rep(i, n) {
        cin >> c[i];
    }
    sort(c.begin(), c.end());
    ll pow4n = 1LL;
    rep(i, n - 1) {
        pow4n *= 4;
        pow4n %= mod;
    }

    ll ans = 0;
    rep(i, n) {
        ans += c[i] * (n - i + 1);
        ans %= mod;
    }

    ans *= pow4n;
    ans %= mod;
    cout << ans << endl;
    return 0;
}