# after listening explanation
mod = 1000000007
n = gets.to_i
c = gets.split.map(&:to_i)
c.sort!
c.reverse!
list = [0,1].repeated_permutation(n).to_a
list.shift
num = 0
sum = n.times.map{|i|
  num = (2**(n-1)+(2**(n-2))*i).to_i
  (c[i]*num)%mod
}.inject(:+)
ans = (2**n) % mod
p ans*sum % mod
