import scala.collection.mutable

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()))

  var dict = mutable.Set[String]()

  for ((cmd, str) <- input) {
    cmd match {
      case "insert" => dict add str
      case "find"   => println(if (dict contains str) "yes" else "no")
    }
  }
}

