def sd()
  q = Hash.new(0)
  p = gets.to_i
  for i in 0..p-1
    a = gets.split(' ')
    if a[0] == 'insert'
      q[a[1]] = 1
    elsif a[0] == 'find'
      if q[a[1]] == 1
        puts 'yes'
      else
        puts 'no'
      end
    end
  end
end

sd()