dict = {}
gets.to_i.times{
  command, str = gets.split
  case command
  when 'insert'
    dict[str] = 1
  when 'find'
    if dict[str] == 1 then
      puts "yes"
    else
      puts "no"
    end
  end
}