import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

enum P = 10L^^9+7;

long pow(long x, long n) {
    long y = 1;
    while (n) {
        if (n%2 == 1) y = (y * x) % P;
        x = x^^2 % P;
        n /= 2;
    }
    return y;
}

void main()
{
    auto N = readln.chomp.to!long;
    auto CS = readln.split.to!(long[]);
    sort!"a > b"(CS);
    auto ds = new long[](N);
    ds[0] = pow(2, N*2-1);
    foreach (long i; 1..N) ds[i] = (ds[0] + (((ds[0] * 500000004) % P) * i) % P) % P;
    long r;
    foreach (i; 0..N) r = (r + (CS[i] * ds[i]) % P) % P;
    writeln(r);
}