
fun main(args: Array<String>) {
    var n:Int = readLine()!!.toInt()
    val dic = mutableMapOf<String,Int>()
    while(n>0)
    {
        val list: List<String> = readLine()!!.split(" ").map { it.toString() }
        when(list[0])
        {
            "insert" -> {
                if (!dic.containsKey(list[1]))
                {
                    dic[list[1]] = n
                }
            }
            "find" -> {
                if (!dic.containsKey(list[1]))
                {
                    println("no")
                }
                else
                {
                    println("yes")
                }
            }
        }
        n--
    }
}
