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

char dic[1000000][13];

int main(void) {
	int n = 0;		//???????????°.
	int i = 0;
	int j = 0;
	int k = 0;

	char ord[7];					//??????.
	char sea[13];					//????´¢?????????.

	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		scanf("%s", ord);

		if (strcmp(ord, "insert") == 0) {
			scanf("%s", dic[j]);
			j++;
		}
		else if (strcmp(ord, "find") == 0) {
			scanf("%s", sea);
			k = 0;
			do{
				k++;

				if (k == j + 1)
					break;

			} while (strcmp(sea, dic[k-1]) != 0);

			if (k == j+1)
				printf("no\n");
			else
				printf("yes\n");
		}
			
	}

	return 0;
}