n = gets.to_i
commands = Array.new(n){gets.split}
dict = {}

commands.each do |com|
  case com[0]
  when "insert"
    dict[com[1]] = com[1]
  when "find"
    puts (dict.has_key?(com[1]) ? "yes" : "no")
  end
end
