def h(key)
  key.hash % 1046527
end

class Dict
  def initialize
    @arr = []
  end
  def insert(s)
    @arr[h(s)] = s
  end
  def find(s)
    @arr[h(s)]
  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
}