/* ALDS1_4_C on AOJ */

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

#define N_MAX 1000000
#define STR_LEN_MAX 12

void lntrim(char *str) {
    char *p;
    p = strchr(str, '\n');
    if(p != NULL) {
        *p = '\0';
    }
    p = strchr(str, '\r');
    if(p != NULL) {
        *p = '\0';
    }
}

void insert(char *str, char dic[][STR_LEN_MAX])
{
    unsigned short  ii;
    unsigned int    hash, hash1, hash2;
    
    /* make hash value */
    hash = 0;
    hash1 = 0;
    hash2 = 0;
    ii = 0;
    lntrim(str);
    while(str[ii] != '\0' && ii < STR_LEN_MAX + 2){
        hash1 += (unsigned int)str[ii] << ii;
        hash2 |= (unsigned int)str[ii] << ii;
        hash2 &= hash1;
        ii++;
    }
    hash = (hash1 + hash2 % N_MAX);
    
    /* debug code */
    //printf("%s , hash = %d\n", str,hash);
    
    /* discrimination of possible to insert string to dictionary */
    /*
    while(dic[hash][0] != '\0'){
        if(hash >= STR_LEN_MAX - 1){
            hash = 0;
        }
        hash++;
    }
    */
    
    /* insert string to dictionary */
    strcpy(&dic[hash][0], str);
}

void find(char *str, char dic[][STR_LEN_MAX])
{
    unsigned short  ii;
    unsigned int    hash, hash1, hash2;
    
    /* make hash value */
    hash = 0;
    hash1 = 0;
    hash2 = 0;
    ii = 0;
    lntrim(str);
    while(str[ii] != '\0' && ii < STR_LEN_MAX + 2){
        hash1 += (unsigned int)str[ii] << ii;
        hash2 |= (unsigned int)str[ii] << ii;
        hash2 &= hash1;
        ii++;
    }
    hash = (hash1 + hash2 % N_MAX);
    
    /* debug code */
    /* printf("%s , hash = %d\n", str,hash); */
    
    /* search */
    /*
    ii = hash;
    while(strcmp(str, &dic[ii][0]) != 0){
        if(ii >= STR_LEN_MAX - 1){
            ii = 0;
        }else if(ii == hash - 1){
            printf("no\n");
            return;
        }else if(dic[ii][0] == '\0'){
            printf("no\n");
            return;
        }
        ii++;
    }
    */
    if(dic[hash][0] != '\0'){
        printf("yes\n");
    }else{
        printf("no\n");
    }
}

int main(void)
{
    char    buf[STR_LEN_MAX + 8];
    char    dic[N_MAX][STR_LEN_MAX];
    short   n, ii;
    
    /* get n param */
    fgets(buf, sizeof(buf), stdin);
    n = atoi(buf);
    
    for(ii = 0; ii < n; ii++){
        
        /* get command and string */
        fgets(buf, sizeof(buf), stdin);
        
        /* command discrimination */
        switch(buf[0]){
            case 'i':
                /* insert to dictionary */
                insert(&buf[7], dic);
                break;
            case 'f':
                /* search from dictionary */
                find(&buf[5], dic);
                break;
            default:
                break;
        }
        
    }
    
    return 0;
}
