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

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


char dic[1000][12];
int x = 0;

int main(){

  int n;
  char str[12],op[7],r,i;

  scanf("%d",&n);

  for(i = 0 ; i < n ; i++){
    
    scanf("%s",op);
    scanf("%s",str);


    if(strcmp(op,"insert")==0) insert(str);
    
    else if(strcmp(op,"find")==0){
      if(find(str)==1) printf("yes\n");
      else printf("no\n");
    }
    
  }


  return 0;

}

  
void insert(char *s){

  int j;

  strcpy(dic[x],s);

  x++;


}


int find(char *s){

  int left,right,mid;

  left = 0;
  right = x;


  while(left < right){

    mid = (left + right)/2;
      
    if(strcmp(dic[mid],s)==0 ) return 1;

    if(strcmp(dic[mid],s) < 0) left = mid + 1;
    else if(strcmp(dic[mid],s) > 0) right = mid;
    
  } 
  
  return 0;

}