#include <bits/stdc++.h>
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long int;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF = 1e10;
const ll MOD = 1000000007;
template<uint_fast64_t Modulas = 1000000007ul>
class ModInt {
    using u64 = uint_fast64_t;
public:
    u64 x;
 
    constexpr ModInt() : x(0) {}
    constexpr ModInt(const u64 x) : x(x % Modulas) {}
    constexpr ModInt operator+(const ModInt rhs) const noexcept {
        return ModInt(*this) += rhs;
    }
    constexpr ModInt operator-(const ModInt rhs) const noexcept {
        return ModInt(*this) -= rhs;
    }
    constexpr ModInt operator*(const ModInt rhs) const noexcept {
        return ModInt(*this) *= rhs;
    }
    constexpr ModInt operator/(const ModInt rhs) const noexcept {
        return ModInt(*this) /= rhs;
    }
    constexpr ModInt operator/(const long long rhs) const noexcept {
        return ModInt(*this) /= rhs;
    }
    constexpr ModInt operator+=(const ModInt rhs) noexcept {
        x += rhs.x;
        if (x >= Modulas) x -= Modulas;
        return *this;
    }
    constexpr ModInt operator+=(const long long rhs) noexcept {
        auto hs = ModInt<Modulas>(rhs);
        (*this) += hs;
        return *this;
    }
    constexpr ModInt operator-=(const ModInt rhs) noexcept {
        if (x < rhs.x) x += Modulas;
        x -= rhs.x;
        return *this;
    }
    constexpr ModInt operator-=(const long long rhs) noexcept {
        auto hs = ModInt<Modulas>(rhs);
        (*this) -= hs;
        return *this;
    }
    constexpr ModInt operator*=(const ModInt rhs) noexcept {
        x = x * rhs.x % Modulas;
        return *this;
    }
    constexpr ModInt operator*=(const long long rhs) noexcept {
        auto hs = ModInt<Modulas>(rhs);
        (*this) *= hs;
        return *this;
    }
    constexpr ModInt &operator/=(ModInt rhs) noexcept {
        u64 exp = Modulas - 2;
        while (exp > 0) {
            if (exp & 1ul) *this *= rhs;
            rhs *= rhs;
            exp >>= 1ul;
        }
        return *this;
    }
    constexpr ModInt &operator/=(long long rhs) noexcept {
        auto hs = ModInt<Modulas>(rhs);
        (*this) /= hs;
        return *this;
    }
 
    constexpr ModInt &operator++() noexcept {
        x++;
        if (x >= Modulas) x -= Modulas;
        return *this;
    }
    constexpr ModInt &operator--() noexcept {
        if (x == 0) x += Modulas;
        x--;
        return *this;
    }
    constexpr bool operator<(const ModInt rhs) const noexcept {
        return x < rhs.x;
    }
    constexpr bool operator==(const ModInt rhs) const noexcept {
        return this->x == rhs.x;
    }
    constexpr bool operator!=(const ModInt rhs) const noexcept {
        return !(*this == rhs);
    }
    friend istream &operator>>(istream &in, ModInt &m) {
        in >> m.x;
        m.x %= Modulas;
        return in;
    }
    friend ostream &operator<<(ostream &out, const ModInt &p) {
        out << p.x;
        return out;
    }
    constexpr ModInt pow(u64 p) const {
        ModInt ret(1);
        ModInt mul(x);
        while (p > 0) {
            if (p & 1ul) ret *= mul;
            mul *= mul;
            p >>= 1ul;
        }
        return ret;
    }
    constexpr ModInt operator~() const noexcept {
        u64 exp = Modulas - 2;
        return pow(exp);
    }
};
typedef pair<ll,ll> P;
ll RepeatSquaring(ll N, ll P, ll M){
    if(P==0) return 1;
    if(P%2==0){
        ll t = RepeatSquaring(N, P/2, M);
        return t*t % M;
    }
    return N * RepeatSquaring(N, P-1, M);
}
int main() {
    ll n;
    cin >> n;
    vector<ll> c(200010);
    rep(i,n) cin >> c[i];
    sort(rbegin(c),rend(c));
    ModInt<MOD> ans = 0;
    rep(i,n){
        ans +=c[i]*(i+2);
    }
    rep(i,n-1){
        ans *= 4;
    }
    PRINT(ans);
    return 0;
}

Measured memory_bytes: 1792