#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 1000000
#define HASH 100

/*-----構造体定義------*/
typedef struct word{
 char name[13];
 struct word* next;
 int hashnum;
}word;
/*------------------*/


/*-------hash関数--------*/
int hash(char str[13]){
int i;
int sum=0;

for(i=0;str[i]!='\0';i++){
 sum+=(int)str[i];
}

return sum%HASH;
}
/*------------------------*/


/*----------wordの作成---------*/
word* makecell(char str[13]){

word *new;
new=(word*)malloc(sizeof(word));
strcpy(new->name,str);
new->hashnum=hash(str);
new->next=NULL;

return new;
}
/*-------------------------------*/

/*--------insert------------------*/
void insert(word* p,word* A[]){
word *q;

if(A[p->hashnum]==NULL){A[p->hashnum]=p;}
else{
 q=A[p->hashnum];
 while(q->next!=NULL){
  q=q->next;
 }
 q->next=p;
}


return;
}
/*--------------------------------*/


/*----------------find------------*/
int find(char str[13],word* A[]){
int x=hash(str);
word *p=A[x];

while(p!=NULL){
 if(strcmp(str,p->name)==0){return 1;}
 else{p=p->next;}
}

return 0;
}
/*---------------------------------*/


int main(){
int n,i;
char com[7];
word* A[HASH];
word* p;
char temp[13];
int x;
int C[MAX];

scanf("%d",&n);

for(i=0;i<n;i++)C[i]=-1;
for(i=0;i<HASH;i++)A[i]=NULL;



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

 switch(com[0]){
  case 'i':scanf("%s",temp);
           p=makecell(temp);
           insert(p,A);
           break;

  case 'f':scanf("%s",temp);
           C[i]=find(temp,A);
           break;
 }
}





for(i=0;i<n;i++){
 if(C[i]==0){printf("no\n");}
 else if(C[i]==1){printf("yes\n");}
}




return 0;
}
