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

int search(char[] , int );

char inputdata[2000000][15];
int answer[2000000];

int main(){

  int datasum,i;
  char command[10];
  char finddata[20];
  int inputdatasum;
  int answer[2000000];
  int findsum;
  
  inputdatasum = 0;
  findsum = 0;


  scanf("%d",&datasum);

  for(i = 0; i < datasum; i++){

    scanf("%s",command);

    if((strcmp(command,"insert"))== 0){

      scanf("%s",inputdata[inputdatasum]);

      inputdatasum += 1;

    }

    if( (strcmp(command,"find")) == 0){

      scanf("%s",finddata);

      answer[findsum] = search(finddata,inputdatasum);

      findsum = findsum + 1;

      }

  }

  for(i = 0; i < findsum; i++){

    if(answer[i] == 1){

      printf("yes\n");

    }

    else{

      printf("no\n");

    }

  }
 
   return 0;  
}

int search(char searchdata[20], int inputsumdata){

  int i,flag;

  flag = 0;

  for(i = 0; i < inputsumdata; i++){

    if((strcmp(searchdata,inputdata[i])) == 0){

      flag = 1;

      return 1;

      break;

    }
  }


    return 0;

}