let inputStr = '';

process.stdin.on('data', (input) => { inputStr += input; });

process.stdin.on('end', () => {
  proc(inputStr.split('\n'));
});

const proc = (arr) => {
  const dict = {};

  arr.forEach((row) => {
    const splitted = row.split(' ');
    if (splitted.length !== 2) return;
    const [cmd, val] = splitted;
    if (cmd === 'insert') {
      dict[val] = true;
      return;
    }

    console.log(dict[val] ? 'yes' : 'no');
  });
};
