n = gets.to_i
dic = []
(0..n-1).each do |i|
  order, word = gets.chomp.split(" ")
  if(order=="insert") then
    dic.push(word)
  end
  if(order=="find")
    found = false

    if (dic.include?(word)) then
      puts "yes"
    else
      puts "no"
    end
  end
end