#!/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)
  i=0
  j=s.length-1
  if c < s[i] or c > s[j] then
    return false
  end
  while j>i do
    k=(i+j)/2
    if c == s[i] or c == s[j] or c ==  s[k] then
      return i
    elsif c < s[k] then
      j=k-1
    else
      i=k+1
    end
  end
  false
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[k] then
      j=k-1
    else
      i=k+1
    end
  end
  return j
end

class Dict
  def initialize
    @dic = []
  end

  def insert(x)
    i = binidx(x, @dic)
    if i==0 then
      @dic.unshift(x)
    else
      @dic = @dic.slice(0..(i-1)).concat([x].concat(@dic.slice(i..(@dic.length-1))))
    end
    x
  end

  def find(s)
    binsrch(s, @dic)
  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