def solve():

  ans = 0

  N = int(eval(input()))

  C = list(map(int, input().split()))

  C.sort()

  mod = 10**9+7

  for i in range(N):

    ans += C[i]*(N+1-i)

    ans %= mod

  ans = ans*pow(2,2*N-2,mod)%mod

  return ans

print((solve()))
def solve():

  ans = 0

  N = int(eval(input()))

  C = list(map(int, input().split()))

  C.sort()

  mod = 10**9+7

  for i in range(N):

    ans += C[i]*(N+1-i)

  ans = ans*pow(2,2*N-2)%mod

  return ans

print((solve()))
def solve():
    ans = 0
    N = int(eval(input()))
    C = list(map(int, input().split()))
    C.sort()
    mod = 10**9 + 7
    for i in range(N):
        ans += C[i] * (N + 1 - i)
        ans %= mod
    ans = ans * pow(2, 2 * N - 2, mod) % mod
    return ans


print((solve()))

def solve():
    ans = 0
    N = int(eval(input()))
    C = list(map(int, input().split()))
    C.sort()
    mod = 10**9 + 7
    for i in range(N):
        ans += C[i] * (N + 1 - i)
    ans = ans * pow(2, 2 * N - 2) % mod
    return ans


print((solve()))

-        ans %= mod -    ans = ans * pow(2, 2 * N - 2, mod) % mod +    ans = ans * pow(2, 2 * N - 2) % mod