require 'set'
h = Set.new
n = gets.to_i
n.times{|i|
    x, y = gets.split
    case x
    when "insert" then
        h.add(y)
    when "find" then
        if h.include?(y) then
            puts "yes"
        else
            puts "no"
        end
    end
}
