object Main extends App {

  val sc = new java.util.Scanner(Console.in)

  def next() = sc.next()
  def nextInt() = next().toInt

  val n = nextInt()
  val input = Seq.fill(n)((next(), next()))

  def run(insts: Seq[(String, String)], dict: List[String]): Unit = {
    if (insts.nonEmpty) {
      val (cmd, str) = insts.head
      cmd match {
        case "insert" => run(insts.tail, str::dict)
        case "find" => {
          println(if (dict.exists(_==str)) "yes" else "no")
          run(insts.tail, dict)
        }
      }
    }
  }

  run(input, List())
}

