fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val dictionary = mutableSetOf<String>()
    repeat(n) {
        val (command, s) = readLine()!!.split(' ')
        when (command) {
            "insert" -> dictionary.add(s)
            "find" -> println(if (dictionary.contains(s)) "yes" else "no")
        }
    }
}
