require 'set'
def dictionary(orders)
  set = Set.new
  length = orders.length
  for i in 0..(length-1)
    if orders[i][0] == "insert"
      set.add(orders[i][1])
    elsif orders[i][0] == "find"
      if set.include?(orders[i][1]) == false
        puts "no"
      else
        puts "yes"
      end
    else
      puts "error!"
    end
  end
end

n = gets.chomp.to_i
orders = []
n.times do
  order = gets.chomp.split
  orders.push(order)
end
dictionary(orders)