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

int main(){
  char command[6],str[12],dic[500000][12];
  int n,i,j,a = 0,flag = 0;
  
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf("%s%s",command,str);
    if(strcmp(command, "insert") == 0){
      strcpy(dic[a],str);
      a++;
    }
    else if (strcmp(command, "find") == 0){
      for (j = 0; j < i; j++){
	flag = 0;
	if(strcmp(str,dic[j]) == 0){
	  printf("yes\n");
	  flag = 1;
	  break;
	}
      }
      if(flag != 1){
	printf("no\n");
      }
    }
  }
  return 0;
}
   