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

struct node{
    char elem[12];
    struct node* next;
};

struct node* initlist(void){
    struct node *s;
    s=(struct node*)malloc(sizeof(struct node));
    s->next=NULL;
    return s;
}

int find(char str[],struct node *s){
    s=s->next;
    while(s!=NULL){
        if(strcmp(s->elem,str)==0)return 1;
        s=s->next;
    }
    return 0;
}

void insert(char str[],struct node *s){
    struct node *n;
    n=(struct node*)malloc(sizeof(struct node));
    strcpy(n->elem,str);
    n->next=NULL;
    
    n->next=s->next;
    s->next=n;
}

int main(void){
    char str[12],cmd[6];
    struct node *s;
    int n,i,a[1000000],j=0;
    
    s=initlist();
    
    scanf("%d",&n);
    
    for(i=0;i<n;i++){
        scanf("%s %s",cmd,str);
        if(strcmp(cmd,"insert")==0){
            insert(str,s);
        }
        if(strcmp(cmd,"find")==0){
            if(find(str,s)==1)a[j]=1;
            else a[j]=0;
            j++;
        }
    }
    
    for(i=0;i<j;i++){
        if(a[i]==1)printf("yes\n");
        else printf("no\n");
    }
    
    return 0;
}