n = gets.to_i
dict = Array.new

n.times do
    command, str = gets.chomp.split
    case command
    when "insert"
        dict.push(str)
    when "find"
        if dict.include? str
            puts "yes"
        else
            puts "no"
        end
    end
end
