import scala.io.StdIn.{readInt,readLine}
import scala.collection.mutable.HashMap
import scala.collection.mutable.ArrayBuffer

object Main extends App {
  val n = readInt
  val map = new HashMap[String,Int]
  val b = new ArrayBuffer[String]
  for(i<-1 to n) {
    val s = readLine.split(" ")
    if(s(0)(0)=='i') map(s(1)) = 1
    else if(map.contains(s(1))) b+="yes" else b+= "no"
  }
  println(b.mkString("\n"))
}