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

//int findword(char**, int, char*);

int main(){
  int num, wordcount, flag, i, j;
  char str[12], word[10000][12];
  
  scanf("%d", &num);
  wordcount = 0;
  
  for(i = 0; i < num; i++){
    scanf("%s", str);
    
    if(strcmp(str, "insert") == 0){
      scanf("%s", str);
      strcpy(word[wordcount], str);
      wordcount++;
    }
    else if(strcmp(str, "find") == 0){
      scanf("%s", str);
      
      flag = 0;
      for(j = 0; j < wordcount; j++){
	if(strcmp(word[j],str) == 0){
	  flag = 1;
	  break;
	}
      }
      if(flag ==1){
	printf("yes\n");
      }
      else{
	printf("no\n");
      }
    }
    /*
      for(j = 0; j < wordcount; j++){
	printf("%s\n", word[j]);
	}
    */     
  }
  return 0;
}
/*
void findword(char** list, int num, char* word){
  int left, right, mid;
  
  i = 0;
  
  for(i = 0; i < num; i++)
      if(strcmp(list[mid],word) == 0){
	return 1;
    }

  return 0;
}
*/

