dict = []
gets.to_i.times{
  command, str = gets.split
  case command
  when 'insert'
    dict.push(str)
  when 'find'
    key = [str]
    if (dict & key).size == 0 then
      puts "no"
    else
      puts "yes"
    end
  end
}