MODE = "stdio"
#require 'matrix'
#include Math
line = Array.new

if(defined? MODE)
  line = STDIN.read.split("\n")
else
  tmp = '13
  insert AAA
  insert AAC
  insert AGA
  insert AGG
  insert TTT
  find AAA
  find CCC
  find CCC
  insert CCC
  find CCC
  insert T
  find TTT
  find T'.split("\n")
  tmp.each{|s|
    line << s.strip
  }
end

n = line[0].to_i
dict = {}
(1..n).each do |k|
  cmd, str = line[k].split(" ")
  if cmd == 'insert'
    dict[str] = true
  else
    if dict[str]
      puts "yes"
    else
      puts "no"
    end
  end
end