n = gets.to_i
list = []
ans = []

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? 
      ans.unshift("yes")
    else
      ans.unshift("no")
    end
  end
end
puts ans.join("\n")