dic = {}
n = gets.to_i
(n).times do |i|
  command,word = gets.split
  case command
  when "insert" then
    dic[word]=1
  when "find" then
    printf("%s\n", dic.has_key?(word) ? "yes" : "no")
  end
end
