# frozen_string_literal: true in_n, in_q = gets.chomp.split.map(&:to_i) in_q.times do in_x = gets.chomp if in_x.include?(in_n.to_s) puts "Yes" next end if in_x.to_i % in_n == 0 puts "Yes" else puts "No" end end