doc=Array.new
n=gets.to_i
n.times do |i|
  x=gets.split(" ")
  if x[0]=="insert" then
    doc.push(x[1])
  elsif  x[0]=="find" then
    if doc.include?(x[1]) then
      print "yes\n"
    else
      print "no\n"
    end
  end
end
