MOD = 10**9+7
N = gets.chomp.to_i
str = gets.split
a = Array.new(N)
for i in 0...N do
    a[i] = str[i].to_i
end
a.sort!

answer = 1
for i in 1...N do
    answer = answer * 2 % MOD
end
x = 0
for i in 1..N do
    x += a[-i] * (i+1)
    x %= MOD
end
answer *= x
answer %= MOD
for i in 1...N do
    answer = answer * 2 % MOD
end
puts answer