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

//??£????????????
typedef struct cell{
    char *key;
    int value;
    struct cell *next;
} Cell;

//???????????\??¨
typedef struct{
    int size, count;
    Cell **table;
} HashTable;

//???????????????
Cell *make_cell(const char *key, int val, Cell *next){
    Cell *cp = malloc(sizeof(Cell));
    if(cp != NULL){
        cp->key = malloc(strlen(key) + 1);
        if(cp->key == NULL){
            free(cp);
            return NULL;
        }
        strcpy(cp->key,key);
        cp->value = val;
        cp->next = next;
    }
    return cp;
}

//?????????????£?
void delete_cell(Cell *cp){
    while(cp != NULL){
        Cell *xs = cp->next;
        free(cp->key);
        free(cp);
        cp = xs;
    }
}

//???????????\??¨?????????
HashTable *make_hash_table(int size){
    HashTable *ht = malloc(sizeof(HashTable));
    if(ht != NULL){
        ht->size = size;
        ht->table = malloc(sizeof(Cell *) * size);
        if(ht->table == NULL){
            free(ht);
            return NULL;
        }
        //?????????
        for(int i=0;i<size;i++)ht->table[i] = NULL;
    }
    return ht;
}

//???????????\??¨???????£?
void delete_hash_table(HashTable *ht){
    for(int i=0;i<ht->size;i++)
        delete_cell(ht->table[i]);
    free(ht);
}

//???????????\??¢??°
int hash_func(HashTable *ht, const char *key){
    unsigned int value = 0;
    for(;*key!='\0';key++)
        value = (value << 3) + *key;
    return value % ht->size;
}

//????\???¨??¢??°
Cell *search_cell(HashTable *ht, const char *key, int hval){
    Cell *cp = ht->table[hval];
    for(;cp!=NULL;cp=cp->next){
        if(strcmp(cp->key, key)==0){
            return cp;
        }
    }
    return NULL;
}

//??????????????¢?´¢
int search_hash(HashTable *ht, const char *key, bool *err){
    Cell *cp = search_cell(ht, key, hash_func(ht, key));
    if(cp!=NULL){
        *err=true;
        return cp->value;
    }
    *err = false;
    return 0;
}

//?????????????????\
bool insert_hash(HashTable *ht, const char *key, int val){
    int hval = hash_func(ht, key);
    Cell *cp = search_cell(ht, key, hval);
    if(cp==NULL){
        //???????????????
        ht->table[hval] = make_cell(key, val, ht->table[hval]);
        ht->count++;
        return true;
    }else{
        cp->value = val;
        return false;
    }
}

//??????????????????
bool delete_hash(HashTable *ht, const char *key){
    int hval = hash_func(ht, key);
    Cell *cp = ht->table[hval];
    if (cp != NULL) {
        if (strcmp(cp->key, key) == 0) {
            // ????????????????????????
            ht->table[hval] = cp->next;
            ht->count--;
            free(cp->key);
            free(cp);
            return true;
        }else{
            // ??????????????????????????????
            for (; cp->next != NULL; cp = cp->next) {
                if (strcmp(cp->next->key, key) == 0) {
                    Cell *del = cp->next;
                    cp->next = cp->next->next;
                    ht->count--;
                    free(del->key);
                    free(del);
                    return true;
                }
            }
        }
    }
    return false;
}

// ??????
void foreach_hash(void (*func)(const char *, int), HashTable *ht){
    for (int i = 0; i < ht->size; i++) {
        for (Cell *cp = ht->table[i]; cp != NULL; cp = cp->next)
        func(cp->key, cp->value);
    }
}

// ???????????\?????????
bool is_empty_hash(HashTable *ht){
    return ht->count == 0;
}

// ????´???°?????????
int length_hash(HashTable *ht){
    return ht->count;
}

// ???????????\???????????????
void clear_hash(HashTable *ht){
    ht->count =0;
    for (int i = 0; i < ht->size; i++) {
        delete_cell(ht->table[i]);
        ht->table[i] = NULL;
    }
}

int main(void){
    int n, i;
    char str[12], inst[6];
    HashTable *ht = make_hash_table(13);
    bool err;
    scanf("%d", &n);
    for(i=0;i<n;i++){
        scanf("%s%s", inst, str);
        switch(inst[0]){
            case 'i':
                insert_hash(ht, str, i);
                break;
            /*case 'r':
                delete_hash(ht, str);
                break;*/
            case 'f':
                search_hash(ht, str, &err);
                if(err==true){
                    printf("yes\n");
                }else{
                    printf("no\n");
                }
                break;
            default:
                break;
        }
    }
    return 0;
}