size = gets.to_i
d = {}

size.times do
  sp = gets.chomp.split(" ")
  if sp[0] == "insert"
    d[sp[1].to_sym] = nil
  else
    if d.has_key?(sp[1].to_sym)
      puts 'yes'
    else
      puts 'no'
    end
  end
end
