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

char data[M];
int top=0;

int main(){
  int i,j=0,b,count=0,k=0;
  char a[N],c[N],d,e[M],f[M][3];
  scanf("%d",&b);
  for(i=0;i<b;i++){
    scanf("%s%s",a,c);
    if((strcmp(a,"insert"))==0){
	strcpy(e,c);
    }

    if((strcmp(a,"find"))==0){
      for(j=0;j<M;j++){
	if((strcmp(c,e))==0){
	  strcpy(f[k], "yes");
	}
	else if(strcmp(c,e)!=0){
	  strcpy(f[k],"no");
	}
      }
      k++;
    }
  }
  
  for(j=0;j<b;j++){
    printf("%s\n",f[j]);
  }
  return 0;
}