# 
n=gets.to_i
# print(n)
hash={}
# while num<n:
n.times{
    str=gets.split(' ')
    if str[0]=='insert'
        hash[str[1]]=1
    end
    if str[0]=='find'
        if hash[str[1]]==1
            puts "yes"
        else
            puts "no"
        end
    end
    
    # hash.sort{|(k1,v1),(k2,v2)| v2<=>v1}
}

# p hash
