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

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

Sample Input 1

5
insert A
insert T
insert C
find G
find A

Sample Output 1

no
yes

Sample Input 2

13
insert AAA
insert AAC
insert AGA
insert AGG
insert TTT
find AAA
find CCC
find CCC
insert CCC
find CCC
insert T
find TTT
find T

Sample Output 2

yes
no
no
yes
yes
yes
=end

class Dict
  def initialize
    @dic = []
  end

  def insert(x)
    @dic = @dic.push(x)
    x
  end

  def find(s)
    @dic.index(s)
  end

end

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

    commands = []
    n = fh.gets.chomp.to_i
    0.upto(n-1){|i|
      begin
        f=fh.gets.split
      rescue => exe
          abort("not enough command?")
      else
        commands.push([f[0],f[1]])
      end
    }

    dt = Dict.new()

    commands.each {|x|
      cmd,op = x
      if cmd == "insert" then
        dt.insert(op)
      elsif cmd == "find" then
        puts (dt.find(op) ? "yes" : "no")
      else
        abort("unknown command:#{cmd}")
      end
    }
  end

end

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