#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int MOD = 1000000007;

long long mod(long long a) {
	a %= MOD;
	return a >= 0 ? a : a+MOD;
}

long long pow_mod(long long a, long long n) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = (res * a) % MOD;
		n >>= 1;
		a = (a * a) % MOD;
	}
	return res;
}

int main() {
	long long n;
	cin >> n;
	vector<long long> C(n);
	for (int i = 0; i < n; i++) cin >> C[i];
	sort(C.begin(), C.end());
	long long ans = 0;
	for (int i = 0; i < n; i++) {
		ans = mod(ans + C[n-1-i] * (2 + i) % MOD);
	}
	ans = mod(ans * pow_mod(2, (n-1)<<1));
	cout << ans << endl;
	return 0;
}