n = gets.to_i
list = []

n.times do
  cmd, str = gets.split
  case cmd
  when "insert"
    list.unshift(str)
  when "find"
    index = list.find_index { |i| i == str }
    unless index.nil?
      puts "yes" 
    else
      puts "no"
    end
  end
end