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

int top;

int find(char dic[][20], char key[]) {
    for (int i = 0; i <= top; i++) {
        if (strcmp(dic[i], key) == 0) {
            return 1;
        }
    }

    return 0;
}

void insert(char dic[][20], char key[]) {
    if (!find(dic, key)) {
        strcpy(dic[top++], key);
    }
}

int main() {
    top = 0;
    int N;

    char command[10];
    char key[20];

    scanf("%d", &N);
    char dic[N][20];

    for (int i = 0; i < N; i++) {
        scanf("%s", command);
        scanf("%s", key);

        if (strcmp(command, "insert") == 0) {
            insert(dic, key);

        } else if (strcmp(command, "find") == 0) {
            if (find(dic, key)) {
                printf("yes\n");
            } else {
                printf("no\n");
            }

        } else {
            printf("this is invalid command.\n");
        }
    }

    return 0;
}

