require 'set'

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

dict = Set.new
commands.each do |c, str|
  case c
  when "insert"
    dict << str
  when "find"
    puts dict.include?(str) ? "yes" : "no"
  end
end
