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

#define L 12
#define N 1000000
int main(void){
  
  char Order[N][L];
  char In[N][L];
  char Lib[N][L];
  int n,i,j,a=0;
  int res[N];
  int c=0;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    
    scanf("%s%s",Order[i], In[i]);
    
    if(strcmp(Order[i], "insert")==0){
      strcpy(Lib[c], In[i]);
      c++;
    }
    
    else if(strcmp(Order[i], "find")==0){
      if(c==0){
	res[a]=0;
	a++;
      }
     
      else for(j=0;j<c;j++){
	
	if(strcmp(In[i], Lib[j])==0){
	  res[a]=1;
	  a++;
	  //printf("yes\n");
	  break;
	}
	
	else if(j==c-1&&strcmp(In[i], Lib[j])!=0){
	  res[a]=0;
	  a++;
	  //printf("no\n");
	  break;
	}
	
	else continue;
      }
    }
  }
  for(i=0;i<a;i++){
    if(res[i]==1) printf("yes\n");
    else if(res[i]==0) printf("no\n");
  }
  return 0;
}

