#include <bits/stdc++.h>
#define rep(i,s,n) for (ll i = s; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

ll modpow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main() {
  ll n;
  cin >> n;
  ll mod = 1000000007;
  vector<ll> c(n);
  rep(i,0,n) cin >> c[i];
  ll k = modpow(4,n-1,mod);
  ll p = 0;
  sort(c.begin(), c.end());
  rep(i,0,n) {
    p += c[i] * (n + 1 - i);
    p %= mod;
  }
  ll ans = k * p % mod;
  printf("%lld\n", ans);
  return 0;
}
