@n = gets(chomp:true).to_i
@a = gets.split.map(&:to_i)
@q = gets(chomp:true).to_i
@m = gets.split.map(&:to_i)

  def check(check_value, sum_value, count)
    if check_value == sum_value
      return true

    elsif count > @n - 1
      return false

    elsif check_value < sum_value
      return false
      
    elsif check(check_value, sum_value, (count + 1)) || check(check_value, (sum_value += @a[count]), (count + 1))
      return true
    end
  end

@m.each do |value|
  puts check(value, 0, 0) ? "yes" : "no"
end

