#include <stdio.h>
#include <string.h>
#define M 1000000

int find(char *, int);
void insert(char *, int);

char r[13][M];

main(){
  int i,j,k,n,f[M];
  char o[7],leng[13];

  scanf("%d", &n);

  for(i = 0,j = k = 0;i < n;i++){
    scanf("%s %s", o, leng);
    if(o[0] == 'i'){
      insert(leng, k);
      k++;
    }
    else if(o[0] == 'f'){
      f[j] = find(leng, k);
      j++;
    }
  }

  for(i = 0;i < j;i++){
    if(f[i] == 0) printf("no\n");
    else if(f[i] == 1) printf("yes\n");
  }
  return 0;
}

int find(char *le, int k){
  int i;
  for(i = 0;i <= k;i++)if( ( strcmp(r[i],le) ) == 0) return 1;
  return 0;
}

void insert(char *le, int k){
  strcpy(r[k],le);
}