class Dic
  def initialize
    @word = [" "]
    @queue = []
  end
  
  def insert(str)
    @word << str
  end
  
  def find(str)
    @queue << str
  end
  
  def exe
    @word.sort!
    @queue.each do |str|
      if include?(@words, str)
        puts 'yes'
      else
        puts 'no'
      end
    end
  end
  
  def include?(arr, n)
    if arr.length == 1
      return arr[0] == n
    else
      if arr[arr.length / 2] <= n
        return include?(arr[arr.length / 2..arr.length - 1], n)
      else
        return include?(arr[0...arr.length / 2], n)
      end
    end
  end
end
dic = Dic.new
gets.to_i.times do
  dic.send(*gets.split(" "))
end
dic.exe