n = gets.chomp.to_i
list = Array.new(12,Array.new)
n.times do 
  order = gets.split{" "}
  case order[0]
    when "insert"
    list[order[1].size].push order[1]
    when "find"
    puts list[order[1].size].include?(order[1]) ? "yes": "no"
  end
end