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

#define rep(i,n) for(i=0;i<(n);i++)
#define For(i,a,b) for(i=(a);i<(b);i++)
#define size 10000

int main(){
  int n,head=0,i,j,k,flag;
  char a[size][12];
  char order[6],key[12];

  scanf("%d",&n);
  rep(i,n){
    scanf("%s %s",order,key);
    if(strcmp(order,"insert")==0){
      strcpy(a[head],key);
      head++;
    }else if(strcmp(order,"find")==0){
      flag=0;
      rep(j,head){
	if(strcmp(key,a[j])==0){
	  flag=1;
	  break;
	}
      }
      if(flag){
	printf("yes\n");
      }else{
	printf("no\n");
      }
    }
  }
  /*
  rep(i,head)
    printf("%s\n",a[i]);
  */
  return 0;
}