n = gets.chomp.to_i
array = []
n.times do
  command, str = gets.split
  if command == 'insert'
    array << str
  else
    if array.include?(str)
      puts 'yes'
    else
      puts 'no'
    end
  end
end