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

typedef struct{
    char word[12+1];
}DIC;

int find(DIC d[],char key[],int head,int tail){
    if(head>tail)return 0;
    
    int mid=(head+tail)/2;
    int sc=strcmp(d[mid].word,key);
    if(sc==0)return 1;
    else if(sc>0)tail=mid-1;
    else head=mid+1;
    
    return find(d,key,head,tail);
}
int getLB(DIC d[],char key[],int head,int tail){
    if(d==NULL)return 0;
    
    int mid=(head+tail)/2;
    int sc=strcmp(d[mid].word,key);
    if(sc>=0){
        if(mid==0||strcmp(d[mid-1].word,key)<0)return mid;
        else tail=mid-1;
    }else{
        if(mid+1>tail||strcmp(d[mid+1].word,key)>0)return mid+1;
        else head=mid+1;
    }
    
    return getLB(d,key,head,tail);
}
DIC* insert(DIC d[],char key[],int target,int *cnt){
    if(*cnt==0)d=(DIC*)malloc(sizeof(DIC));
    else d=(DIC*)realloc(d,sizeof(DIC)*(*cnt+1));
    
    int i;
    for(i=*cnt;i>target;i--)strcpy(d[i].word,d[i-1].word);
    strcpy(d[target].word,key);
    
    (*cnt)++;
    
    return d;
}
int main(void){
    int n;
    scanf("%d\n",&n);
    
    DIC *d;
    d=NULL;
    int cnt=0;
    
    char com[6+1];
    char str[12+1];
    
    while(n--){
        scanf("%s %s\n",com,str);
        switch(com[0]){
            case 'i':
                //insert
                d=insert(d,str,getLB(d,str,0,cnt-1),&cnt);
                break;
            case 'f':
                //find
                if(find(d,str,0,cnt-1))printf("yes\n");
                else printf("no\n");
                break;
        }
    }
    
    return 0;
}

