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

#define N 100000

int main(){

  int  i;
  int  j;
  int  n;
  int  count=0;
  int  a_count=0;
  char answer[N][15];
  char data[15];
  char order[10];
  char str[N][15];

  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%s",order);
    if(strcmp(order,"insert")==0){
      scanf("%s",str[count]);
      count++;
    }
    else if(strcmp(order,"find")==0){
      scanf("%s",data);
      for(j=0;j<count;j++){
	if(strcmp(data,str[j])==0){
	  strcpy(answer[a_count],"yes");
	  a_count++;
          break;
         }
      }
	if(j==count){
	  strcpy(answer[a_count],"no");
	  a_count++;
      }
    }
    else continue;
  }

  for(i=0;i<a_count;i++){
    printf("%s\n",answer[i]);
  }

  return 0;
}