import scala.io.StdIn.{readInt, readLine};
import scala.reflect.ClassTag;
object Main {
    def main(args: Array[String]): Unit = {
        val n = readInt;
        val set = new OriginalSet[String](1000000);
        (0 until n).foreach { i =>
            readLine.split(" ") match {
                case Array("insert", key) => set.insert(key);
                case Array("find", key) => if (set.find(key) == true) println("yes") else println("no");
            }
        }
    }
}

class OriginalSet[A](size: Int)(implicit m: ClassTag[List[A]]) {
    val set = m.newArray(size);
    def insert(key: A): Unit = {
        val index = (key.hashCode & Int.MaxValue) % size;
        if (set(index) == null) {
            set(index) = List(key);
        } else {
            if (! set(index).exists(_ == key)) set(index) = key :: set(index);
        }
    }
    
    def find(key: A): Boolean = {
        val index = (key.hashCode & Int.MaxValue) % size;
        if (set(index) == null) {
            false;
        } else {
            if (set(index).exists(_ == key)) true else false;
        }
    }
}
