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

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

}