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

struct list{
    char key[10];
    struct list *next,*prev;
};

struct list *list;
 
void search(char *str){
    struct list *x = list->next;
    while(x!=list){
      if(!strcmp(x->key,str)){
        printf("yes\n");
        return;
      }
      x = x->next;
    } 
    printf("no\n");
}

void init(){
    list = (struct list *)malloc(sizeof(struct list));
    list->next = list;
    list->prev = list;
}

/*void print(){
    struct list *x = list->next;
    int i = 0;
    while(1){
       if(x == list) break;
       if(i++ > 0) printf(" ");
        //printf("%d", x->key);
        x = x->next;
    }
   //printf("\n");
}*/

void insert(char * key){
    struct list *x = (struct list *)malloc(sizeof(struct list));
    strcpy(x->key,key);
    x->next = list->next;
    list->next->prev = x;
    list->next = x;
    x->prev = list;
}
/*
void delete(struct list *x){
    if(x == list) return;
    x->prev->next = x->next;
    x->next->prev = x->prev;
    free(x);
}
*/
int main(){
    int  n, i;
    char key[10];
    char ins[20];
    scanf("%d", &n);
    init();
 
    for(i = 0; i < n; i++){
      scanf("%s %s", ins, key);
      if(ins[0] == 'i'){
          insert(key);
      }
      else{
        search(key);
      }
      /*
      else if(ins[0] == 'd'){
          if(strlen(ins) > 6){
              if(ins[6] == 'F') delete(list->next);
              else if(ins[6] == 'L') delete(list->prev);
          }else {
              delete(search(key));
          }
      }*/
    }
   // print();
    return 0;
}