require 'set'
a = Set.new
n = gets.chomp.to_i
n.times do
    inst, s = gets.chomp.split(" ")
    if inst[0] == "f"
        if a.include?(s)
            puts "yes"
        else
            puts "no"
        end
    else
        a.add(s)
    end
end