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

typedef struct Node{
    char word[13];
    struct Node *left;
    struct Node *right;
}node;
node *tree;
char keyWord[13];
void insert(node **ref){
    node *newnode;
    node *temp = *ref;
    if(temp == NULL){
        newnode = malloc(sizeof(node));
        strcpy(newnode->word, keyWord);
        newnode->left = NULL;
        newnode->right = NULL;
        (*ref) = newnode;
        return;
    }else{
        if(strcmp(keyWord, temp->word)>0){
            insert(&temp->right);
        }else{
            insert(&temp->left);
        }
    }
}
int find(node **ref){
    node *temp = *ref;
    int i = 0;
    if(temp == NULL) return 0;
    int r = strcmp(temp->word, keyWord);
    if( r == 0) return 1;
    else if(r>0){
        i = find(&temp->left);
    }else{
        i = find(&temp->right);
    }
    return i;
}
int main () {
    long long int n;
    char cmd[7];
    int f;

    scanf("%lld", &n);
    while(n--){
        scanf("%s %s", &cmd, &keyWord);
        if(strcmp(cmd, "insert") == 0){
            insert(&tree);
        }else if(strcmp(cmd, "find") == 0){
            f = find(&tree);
            printf("%s\n", f == 1? "yes":"no");
        }
    }
    return 0;
}

