require 'digest/md5'

H_LEN = 100000
h = Array.new(H_LEN)
len = gets.to_i
while l = gets
  command, str = l.split(' ')
  h_index = Digest::MD5.hexdigest(str).hex % H_LEN
  if command == 'insert'
    h[h_index] = h[h_index] ? h[h_index].push(str) : [str]
  elsif command == 'find'
    found = false
    if h[h_index]
      h[h_index].each do |v|
        if v == str
          found = true
          break
        end
      end
    end
    puts(found ? 'yes' : 'no')
  end
end
