import scala.collection.immutable._
import scala.io.StdIn._
import scala.collection.mutable.Set
object Main {
  def main(args: Array[String]): Unit = {
    val n = readInt
    var set = Set[String]()
    for(i <- 0 until n){
      var temp = readLine.split(" ")
      if(temp(0) == "insert") set.add(temp(1))
      else if(set.contains(temp(1))) println("yes");
      else  println("no");
      
    }
   
  }
}