require 'set'
n = gets.chomp.to_i
list  = Set.new
n.times do 
  order = gets.split{" "}
  case order[0]
    when "insert"
    list.add order[1]
    when "find"
    puts list.include?(order[1]) ? "yes": "no"
  end
end