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