gets
dic = {}

while line = gets do
    op, val = line.chomp.split

    if op[0] == "i" then
        dic[val.to_sym] = val
    elsif dic.member?(val.to_sym)
        puts "yes"
    else
        puts "no"
    end
end
