N = gets.to_i
cs = gets.split.map(&:to_i).sort

i = cs.length - 1
ret = 0
t0 = 2**N
t1 = t0 / 4
t2 = 10**9+7
mul = t0 / 2
while 0 <= i
  ret += cs[i] * mul
  ret = ret % t2
  mul += t1
  i -= 1
end

ret = (t0*ret) % t2

p ret