#include<stdio.h>
#include<string.h>
#define MAX 1000000
#define TRUE 1
#define FALSE -1

int main(){
  int i, n, j, cnt=0, find=FALSE;
  char str[MAX][12], command[MAX][7], str2[MAX][12];

  //printf("enter the n\n");
  scanf("%d", &n);
  for(i=0; i<n; i++){
    scanf("%s", command[i]);
    scanf("%s", str2[i]);
  }
  for(i=0; i<n; i++){
    //printf("command is %s\n", command);
    if(command[i][0] == 'i'){
      strcpy(str[cnt], str2[i]);
      cnt++;
    }
    else if(command[i][0] == 'f'){
      //printf("str2 = %s\n",str2[i] );
      for(j=0; j<=cnt; j++){

	if(strcmp(str[j], str2[i]) == 0) {
	  //printf("str = %s, str2 = %s   ",str[j], str2[i] );
	  printf("yes\n");
	  find = TRUE;
	  break;
	}
      }
      if(find == FALSE) printf("no\n");
      //printf("find is %d\n", find);
      find = FALSE;
    }
  }

  return 0;
}

