#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define SIZE 10000
struct WORD {
	char value[13];
	struct WORD *next;
};
struct WORD* HashTable[SIZE];	//default: all NULL
int HashFunc(char s[]) {
	long long hash = 0;
	for (int i = 0; s[i] != '\0'; i++) {
		hash += s[i] * (i + 1);
	}
	return (int)(hash * 13 % SIZE);
}
void Insert(char s[]) {
	int hash = HashFunc(s);
	struct WORD* newWord = (struct WORD*)malloc(sizeof(struct WORD));
	strcpy(newWord->value, s);
	newWord->next = HashTable[hash];
	HashTable[hash] = newWord;
}
void Find(char s[]) {
	int hash = HashFunc(s);
	struct WORD* pos;
	for (pos = HashTable[hash]; pos != NULL; pos = pos->next) {
		if (!strcmp(s, pos->value)) {
			printf("yes\n");
			return;
		}
	}
	printf("no\n");
	return;
}
int main() {
	int n;
	char command[7], value[13];
	for (int i = 0; i < SIZE; i++) {
		HashTable[i] = NULL;
	}
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%s %s", command, value);
		if (command[0] == 'i') Insert(value);
		else if (command[0] == 'f') Find(value);
	}
	return 0;
}
