#include<stdio.h>

#define N 1000000

int judge(void);

int i,j,n;
char str[N][13],insert[N][13],find[N][13];

int main(){
  
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",str[i]);
    if(strcmp(str[i],"insert")==0){
      scanf("%s",insert[i]);
    }
    if(strcmp(str[i],"find")==0){
      scanf("%s",find[i]);
      if((judge())==1)
	printf("yes\n");
      else
	printf("no\n");
    }
  }
  return 0;
}

int judge(void){
  printf("test\n");
    for(j=0;j<n;j++){
      if(strcmp(find[i],insert[j])==0)
	return 1;
    }
  return 0;
}