
function main(lines) {
    const input = lines.split('\n').slice(1)
    const n = input.length
    
    // let str = []
    let obj = {}
    input.forEach(function(arr){
        const judge = arr.split(' ')

        if(judge[0] === 'insert'){
            // str.push(judge[1])
            obj[judge[1]]= true
        }
        if(judge[0] === 'find'){
            console.log(obj.hasOwnProperty(judge[1]) ? 'yes' : 'no')
            // console.log(str.includes(judge[1]) ? 'yes' : 'no')
        }
    })
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


