object Main extends App {
  val src = io.Source.stdin.getLines.toList.tail.map(_.split(" ").toList).map { case List(cmd, key) => (cmd, key) }

  def judge(tupLi: List[(String, String)], keyLi: List[String], asrLi: List[String]): List[String] = tupLi match {
    case h :: tail if h._1 == "find" =>
      if (keyLi.exists(_ == h._2)) judge(tail, keyLi, "yes" :: asrLi)
      else judge(tail, keyLi, "no" :: asrLi)
    case h :: tail if h._1 == "insert" =>
      judge(tail, h._2 :: keyLi, asrLi)
    case Nil => asrLi.reverse
  }

  println(judge(src, Nil, Nil).mkString("\n"))
}