#include <stdio.h>
#include <string.h>

#define M 1000000
#define L 14

int H[M]; /* Hash Table */

const int getChar[] = {1,0,2,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,4};

/* convert a string into an integer value */
int getKey(char str[]){ // max = 4^12-1 = 16777215
  int i, sum = 0, p = 1;
  for (i = 0; str[i]!='\n'; i++) {
    sum += p*(getChar[str[i]-'A']);
    p *= 5;
  }
  return sum;
}

void find(int key){
  int i;
  for (i=key%M; H[i]>0 ; i=(i+1)%M) {
    if (H[i]==key) {
      fputs("yes\n", stdout);
      return;
    }
  }
  fputs("no\n", stdout);
}

void insert(int key){
  int i;
  for (i=key%M; H[i]>0 ; i=(i+1)%M) {
    if (H[i]==key) return;
  }
  H[i]=key;
}

int main(){
  int i, n;
  char buf[32];
  for (i = 0; i < M; i++) H[i]=0;
  fgets(buf, 32, stdin);
  n=0;
  for (char *p=buf; *p!='\n'; n=n*10+*(p++)-'0');
  for (i = 0; i < n; i++){
    fgets(buf, 32, stdin);
    if (buf[0] == 'i'){
      insert(getKey(buf+7));
    } else {
      find(getKey(buf+5));
    }
  }
  return 0;
}

