n = gets.to_i
a_i = n.times.map { gets.to_i }

def count_number(number, array)
  sum = array.sum

  count = (2..(number - 1)).map{ |i| array.combination(i).to_a }.flatten(1).select{ |ar| ar.sum < (sum - ar.sum) }.map{ |ar| 2^ar.size - 2 }.sum
  return count % 998244353
end

puts(count_number(n, a_i))