#!/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
=end

def binsrch(c, s)
# returns smallest i, which is c<=s[i], equal_to or smaller_than should be judged by caller
# returns s.length if c > s.last
  i=0
  j=s.length-1
  return   i if s==[] or c < s[i]
  return j+1 if c > s[j]
  while i < j do
    k=(i+j)/2
    if c == s[k] then
      return k
    elsif c == s[j] then
      return j
    elsif c < s[k] then
      j=k
    else
      i=k+1
    end
  end
  i
end

def binidx(c, s)
  i=0
  j=s.length-1
  return 0 if s.length==0 or c <= s[i]
  return j+1 if c >= s[j]
  while j>i do
    k=(i+j)/2
    if c == s[i] or c == s[j] or c ==  s[i] then
      return i
    elsif c < s[i] then
      return i
    elsif c < s[k] then
      j=k-1
    else
      i=k+1
    end
  end
  return j
end

class Dict
  def initialize
    @dic = []
  end

  def insert(x)
    insert1(x)
  end

  def insert0(x)
    0.upto(@dic.length-1).each{|i|
      if @dic[i] > x then
        @dic[i,1] = [x] + @dic[i,1]
        return @dic[i,1]
      end
     }
    @dic.push(x)
  end

  def insert1(x)
    if x=="T" then
      #puts "HERE2"
    end
    i = binsrch(x, @dic)
    @dic[i,1] = [x] + @dic[i,1] 
    x
  end

  def find(s)
    #find0(s)
    find1(s)
  end

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

  def find1(s)
    i=binsrch(s, @dic)
    return (s == @dic[i])
  end

end

class Main
  def initialize()
    #fh = open("/home/muz/Downloads/x.txt")
    #fh = open("/home/muz/Downloads/ALDS1_4_C_in2.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
if op=="TG" then
#   STDERR.puts "HERE"
end
        dt.insert(op)
      elsif cmd == "find" then
if op=="G" then
#   STDERR.puts "HERE"
end
        puts (dt.find(op) ? "yes" : "no")
      else
        abort("unknown command:#{cmd}")
      end
    }
  end

end

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