#include<stdio.h>
#include<stdlib.h>

void insert();
int find();   
int conv(char);

typedef struct Node* Nodepointer;

struct Node{
  Nodepointer next[5];
}; 

Nodepoointer makeNode();

int conv(char c){
  if(c == '\0') return 0;
  else if(c == 'A') return 1;
  else if(c == 'C') return 2;
  else if(c == 'G') return 3;
  else if(c == 'T') return 4;
  else return -1;
}

Nodepointer makeNode(){
  int i;
  Nodepointer p;
  p = malloc(sizeof(struct Node));
  for(i=0 ; i<5 ; ++i) p->next[i] = NULL;
  return p;
}

main(){
  int n,i;
  char str[100],order[100];
  Nodepointer head;

  head = makeNode();

  scanf("%d",&n);

  for(i=0 ; i<n ; i++){
    scanf("%s %s",order,str);

    if(order[0] == 'i'){
      insert(head,str);
    }
    else{
      if(find(head,str)) printf("yes\n");
      else printf("no\n");
    }
  }
  return 0;
}