n = gets.to_i
commands = []
n.times {commands << gets.chomp.split}

dict = []
commands.each do |c, str|
  n = dict.size
  case c
  when "insert"
    if dict.empty?
      dict << str
    else
      i = dict.bsearch_index {|x| x >= str}
      i = i ? i : n
      dict = dict[0, i] + [str] + dict[i..-1]
    end
  when "find"
    dict
    a = dict.bsearch {|x| x >= str}
    puts (a == str) ? "yes" : "no"
  end
end
