function main(stdin) {
    const inputs = stdin.split('\n');
    const len = parseInt(inputs.shift(), 10);
    const dict = {};

    for(let i =0;i<len;i++){
        const state = inputs[i].split(' ');
        if(state[0] === 'insert'){
            dict[state[1]] = 1;
        } else {
            console.log(dict[state[1]] ? 'yes' : 'no');
        }
    }
}


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

