#define DIC_MAX 10000
#define WORD_MAX 12
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(void) {
	int n;
	char order[10];
	char word[WORD_MAX];
	char **dictionary = {0};
	int i ,j;
	int tr = 0;

	scanf("%d", &n);
	dictionary = (char **)calloc(n, sizeof(char));

	for (i = 0; i < n; i++) {
		dictionary[i] = (char *)calloc(n, sizeof(char));
	}

	for (i = 0; i < n; i++) {
		scanf("%s %s", order, word);
		if (strcmp(order, "insert") == 0) {
			for (j = 0; strlen(dictionary[j]) != 0 ; j++) {
			}
			strcpy(dictionary[j], word);
		}
		else if (strcmp(order, "find") == 0) {
			for (j = 0; strlen(dictionary[j]) != 0 ; j++) {
				if (strcmp(dictionary[j], word) == 0) {
					tr = 1;
					break;
				}
			}
			if (tr == 1) {
				printf("yes\n");
			}
			else {
				printf("no\n");
			}
			tr = 0;
		}
	}

	for (i = 0; i < n; i++) {
		free(dictionary[i]);
	}
	free(dictionary);

	return 0;
}
