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

struct node{
  char key[12];
  struct node *next;
};
typedef struct node *NodePointer;

NodePointer make_lnode(char str[],NodePointer next);
void insert();
void find();

NodePointer head;
int k;
char y_n[1000][5];

int main(){

  int i, n;
  char str[10];

  k  = 0;

  scanf("%d",&n);


  head = make_lnode("uuu",NULL);

  for(i=0;i<n;i++){
    scanf("%s",str);
    if(strcmp(str,"insert")==0)insert();
    else{
      // fprintf(stderr,"error\n");
      find();
    }
  }
  for(i=0;i<k;i++)printf("%s\n",y_n[i]);

  return 0;
}

NodePointer make_lnode(char str[],NodePointer next){
  NodePointer n;

  if((n = (NodePointer)malloc(sizeof(struct node))) == NULL){
    printf("Error in memory allocation\n");
    exit(8);
  }
  strcpy(n->key,str);
  n->next = next;
  return n;
}
void insert(){
  NodePointer newnode;
  char str1[12];

  scanf("%s",str1);

  newnode = make_lnode(str1,head->next);
  head->next = newnode;

}
void find(){
  NodePointer n;
  char str2[12];
  
  scanf("%s",str2);

  for(n = head; n->next != NULL; n = n->next){
    if(strcmp(n->next->key,str2)==0){
      strcpy(y_n[k],"yes");
      k++;
      return ;
    }
  }
  strcpy(y_n[k],"no");
  k++;
}