gets;
dict = Array.new
$stdin.readlines.each do |l|
    command, str = l.split
    
     # insert
    if command == "insert"
        dict.push(str)
    
    # find
    else
        if dict.include? str
            puts "yes"
        else
            puts "no"
        end
    end
end

