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

count = 0

loop do
  pat = format("%0#{a.size}d", count.to_s(2))
  break if pat.size > a.size
  sum = 0
  pat.size.times { |x| sum += (pat[x] == '0' ? 0 : a[x])  }
  while b.include?(sum)
    b[b.index(sum)] = 'yes'
  end
  count += 1
end

b.each { |e| puts e == 'yes' ? e : "no" }

