#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;


typedef long long LL;

const LL BASE = 1000000007;


LL pow2(LL M) {
	if (M == 0) return 1LL;

	LL a = M / 2;
	LL b = pow2(a);
	b = (b * b) % BASE;
	if (M % 2) b = (b * 2) % BASE;

	return b;
}


int main() {
	int N;
	cin >> N;

	vector<LL> C(N);
	for (int i = 0; i < N; ++i)
		cin >> C[i];

	sort(C.begin(), C.end());

	LL ans = 0;
	for (int i = 0; i < N; ++i) {
		LL cost = (C[i] * (N - i + 1)) % BASE;
		ans = (ans + cost) % BASE;
	}

	ans = (ans * pow2(2 * N - 2)) % BASE;

	cout << ans << endl;

	return 0;
}
