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

int main(){
  int n , i , j , f= 0;
  char input1[12] , input2[12];
  scanf ( "%d\n" , &n);
  char dic[n][12];
  int dc = 0;
  for ( i= 0; i< n ; i++){
    scanf("%s %s\n" , input1 ,input2);
    if ( strcmp(input1,"insert") == 0 ){ strcpy(dic[dc], input2);dc++;}
    else if ( strcmp(input1,"find") == 0 ){
		f =0;
      for ( j = 0 ; j  <= dc; j++){
	    if ( strcmp(input2, dic[j]) == 0 ){f = 1;break;}
      }
      if ( f == 0 ){printf("no\n");}
      else if ( f == 1){printf("yes\n");}
    }
  }
  return 0;
}
