'use strict';

var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = (input.trim()).split('\n');
lines.shift();
var hash = {};

lines.forEach(function(line) {
  var cmd = line.split(' ')[0];
  var key = line.split(' ')[1];
  if (cmd === 'insert') {
    hash[key] = true;
    return;
  }
  if (hash[key]) {
    console.log('yes');
  } else {
    console.log('no');
  }
});