#!/usr/bin/env ruby

n = gets.chomp.to_i

dict = []
n.times do
  action, str = gets.chomp.split

  case action
  when 'insert'
    dict << str
  when 'find'
    puts dict.include?(str) ? 'yes' : 'no'
  end
end