#define DIC_MAX 1000
#define WORD_MAX 12
#define NOT_FOUND -1
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int binarySearch(char a[][WORD_MAX], int n, char key[]) {
	int i;

	for (i = 0; i < n ;i++) {
		if (strcmp(a[i],key) == 0) {
			return i;
		}
	}

	return NOT_FOUND;

	/*
	int left = 0;
	int right = n;
	int mid;

	while (left < right) {
		mid = (left + right) / 2;

		printf("%d\n", mid);

		if (strcmp(a[mid],key) == 0) {
			return mid;
		}
		else if (strcmp(a[mid], key) > 0) {
			right = mid;
		}
		else if (strcmp(a[mid], "\0") == 0) {
			right = mid;
		}
		else {
			left = mid + 1;
		}
	}

	return NOT_FOUND;
	*/
}

int main(void) {
	int n;
	char order[10];
	char word[WORD_MAX];
	char dictionary[DIC_MAX][12] = { 0 };
	int i;
	int k = 0;
	int tr = 0;

	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		scanf("%s %s", order, word);
		if (strcmp(order, "insert") == 0) {
			strcpy(dictionary[k], word);
			k++;
		}
		else if (strcmp(order, "find") == 0) {

			if (binarySearch(dictionary, n, word) >= 0) {
				tr = 1;
			}
			else {
			}

			if (tr == 1) {
				printf("yes\n");
			}
			else {
				printf("no\n");
			}
			tr = 0;
		}
	}

	return 0;
}
