_, *orders = readlines.map(&:chomp)
orders = orders.map(&:split)
dictionary = {}
orders.each do |o, s|
  if o == 'insert'
    dictionary[s] = dictionary.size + 1
  else
    puts dictionary[s] ? 'yes' : 'no'
  end
end
