n = gets.to_i
require 'set'
s = Set.new
for i in 1..n
  com,name = gets.split
  case com
  when "insert"
    s.add(name)
  when "find"
    if s.include?(name)
      puts "yes"
    else
      puts "no"
    end
  end
end