object Main extends App {

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

  val dict = collection.mutable.HashSet[String]()

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

  def loop(n: Int): Unit = if (n != 0) {
    next() match {
      case "insert" => dict.add(next())
      case "find"   => println(if(dict.contains(next())) "yes" else "no")
    }
    loop(n - 1)
  }

  loop(nextInt())
}

