def main2
  n = gets.chomp.to_i
  map = { }
  (1..n).each do |ca|
    command, str = gets.chomp.split(/\s/)
    map[str] = 1 if command == "insert"
    if command == "find"
      flag = map[str]
      puts "yes"  if not flag.nil?
      puts "no" if flag.nil?
    end
  end

end

main2