#include <stdio.h>
#include <string.h>
#include <stdlib.h>
 
#define MAX 1000000
#define Length_char 13
 
int main(void) 
{
    char Dict[MAX][Length_char] = {};
    char cmd[7] = {};
    char obj[Length_char] = {};
    char input[25] = {};
    int max_order = 0;
    int i = 0;
    int j = 0;
    int k = 0;
    int num = 0;
    int flag = 0;
     
    fgets( input, 25, stdin );
    max_order = atoi(input);
     
    for ( i = 0; i < max_order; i++ ) {
        fgets( input, 25, stdin);
         
        for( j = 0; input[j] != ' '; j++ ) {
        }
        input[j] = '\0';
        strcpy(cmd, input);
         
        k = j+1;
        for( ; input[j] != '\r' && input[j] != '\n'; j++ ) {
        }
        input[j] = '\0';
        strcpy(obj, &input[k]);
         
        if ( strcmp(cmd, "insert") == 0 ) {

                strcpy( Dict[num], obj );
                //printf("%s\n", Dict[num]);
                num++;
            
        } else if ( strcmp(cmd, "find" ) == 0) {
            for ( j = 0; j < num; j++ ) {
                flag = 0;
                if ( strcmp( Dict[j], obj ) == 0 ) {
                    printf("yes\n");
                    flag = 1;
                    break;
                } 
            }
             
            if ( flag == 0 ) {
                printf("no\n");
            }
        }
    }
     
    return 0;
}
