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


typedef struct moji{
  char key[13];
  struct moji *r;
  struct moji *l;
}moji;



moji *mk_moji(char *x){
  moji *p;
  p=malloc(sizeof(moji));
  strcpy(p->key,x);
  p->r=NULL;
  p->l=NULL;
  return p;
}
  

void insert(moji **tree,moji *p){
  moji *q;
  if(*tree==NULL) *tree=p;
  else{
  q=*tree;
  while(1){
    if(strcmp(q->key , p->key) <0){
      if(q->r!=NULL) q=q->r;
      else{
        q->r=p;
        break;
      }
    }
    else{
      if(q->l!=NULL) q=q->l;
      else{
        q->l=p;
        break;
       
      }
    }
  }
  }
}

int search(moji *tree,char *x){
  if(tree==NULL) return 0;
  if(strcmp(tree->key,x) <0) return search(tree->r,x);
  if(strcmp(tree->key,x) ==0) return 1;
  return search(tree->l,x);
}


int main(){
  int n;
  int i;
  char x[13];
  char inst[8];
  moji **tree;
  moji *p;
  tree=malloc(sizeof(moji *));
  *tree=malloc(sizeof(moji));
  *tree=NULL;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%*[ \n]%s",inst);
    if(inst[0]=='i'){
      scanf("%*[ \n]%s",x);
      p=mk_moji(x);
      insert(tree,p);
      if(p==NULL) printf("WWW");
    }
    
    if(inst[0]=='f'){
      scanf("%*[ \n]%s",x);
      if(search(*tree,x)==1) printf("yes\n");
      else printf("no\n");
    }
  }
  return 0;
}
