#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)n; i++)
using ll = long long;
const ll mod = 1e9+7;

int main(){
  int n;
  cin >> n;
  ll c[n];
  rep(i,n) cin >> c[i];
  sort(c,c+n);
  ll t = 1;
  rep(i,2*n-2) (t *= 2) %= mod;
  ll ans = 0;
  rep(i,n) {
    ll p = (n+1-i)*t % mod;
    (ans += p*c[i]) %= mod;
  }
  cout << ans << endl;
  return 0;
}