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

#define L 12
#define N 100000
int main(void){

  char Order[N][2];
  char Lib[N];
  int n,i,j;
  int c=0;

  scanf("%d",&n);

  for(i=0;i<n;i++){

    scanf("%s%s",Order[i][0], Order[i][1]);
    if((strcmp(Order[i][0], "insert")==0){
        Lib[c] = Order[i][1];
        c++;
      }

      else if((strcmp(Order[i][0], "find")==0){

          for(j=0;j<c;j++){

            if((strcmp(Order[i][1], Lib[j])==0)){
              printf("yes\n");
              break;
            }

            else if(j==c-1&&(strcmp(Order[i][1], Lib[j])!=0){
                printf("no\n");
                break;
            }
              else continue;
          }
      }

          return 0;
  }
