def h(key)
  key.hash % 1046527
end
def h1(key)
  1 + (key.hash % (1046527 - 1))
end
def h2(key)
  3 + (key.hash % (1046527 - 3))
end

class Dict
  def initialize
    @arr = []
  end
  def insert(s)
    i = h(s)
    x = @arr[i]
    if x == s then
      i = h1(s)
      x == @arr[i]
    end
    if (x == s) then
      i = h2(s)
    end
    @arr[i] = s
  end
  def find(s)
    x = @arr[h(s)]
    if x.nil?
      x = @arr[h1(s)]
    end
    if x.nil?
      x = @arr[h2(s)]
    end
    x
  end
end

n = STDIN.gets.to_i

dict = Dict.new
n.times.each {
  ss = STDIN.gets.split(' ')
  if ss[0] == 'insert' then
    dict.insert(ss[1])
  else
    if dict.find(ss[1]) then
      puts 'yes'
    else
      puts 'no'
    end
  end
}