gets
a = gets.split(' ').map(&:to_i)
gets
b = gets.split(' ').map(&:to_i)

count = 1
loop {
  pat = format("%0#{a.size}d", count.to_s(2))

  break if pat.size > a.size

  sum = pat.split('').map
  .with_index { |e, i| e == '0' ? 0 : a[i] }
  .reduce(:+)

  while b.include?(sum)
    b[b.index(sum)] = 'yes'
  end

  count += 1
}

b.each do |e|
  puts e == 'yes' ? e : 'no'
end

