
count = gets.to_i
arr = []
dic_arr = []

count.times do
  dic, alpha = gets.chomp.split(" ")
  if dic == "insert"
    dic_arr << alpha
  else
    yes_or_no = dic_arr.includes?(alpha) ? 'yes' : 'no'
    arr << yes_or_no
  end
end

puts arr