#!/usr/bin/ruby
# -*- coding: utf-8 -*-
=begin
ALDS1_4-C3
Search - Dictionary
Search III

Constraints
    A string consists of 'A', 'C', 'G', or 'T'
    1 ??? length of a string ??? 12
    n ??? 1000000
=end

class Main
  def initialize()
    #fh = open("/home/muz/Downloads/x.txt")
    #fh = open("/home/muz/Downloads/ALDS1_4_C_in2.txt")
    #fh = open("/home/muz/Downloads/ALDS1_4_C_in9.txt")
    fh = STDIN

    h = Hash.new
    n = fh.gets.chomp.to_i
    0.upto(n-1) {|i|
      begin
        f=fh.gets.split
      rescue => exe
        abort("not enough command?")
      else
        cmd,op = f
        if cmd == "insert" then
          h[op]=true
        elsif cmd == "find" then
          puts (h.has_key?(op) ? "yes" : "no")
        else
          abort("unknown command:#{cmd}")
        end
      end
    }
  end
end

if $0==__FILE__ then
  Main.new()
end