def insert(dic,word)
  n = dic.size
  pos = (0...n).bsearch{|i| word<dic[i]} || n
  dic.insert(pos,word)
end

def find(dic,word)
  if dic.bsearch{|w| w>word ? -1 : (w<word ? 1 : 0)}
    printf("yes\n")
  else
    printf("no\n")
  end
end

dic = []
n = gets.to_i
for i in 1..n do
  command,word = gets.split
  case command
  when "insert" then
    insert(dic,word)
  when "find" then
    find(dic,word)
  end
end
