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

#define HASH_M 97
#define HASH_A 128
#define STR_SIZE 16

typedef struct DATA{
	struct DATA *next;
	char str[STR_SIZE];
}Data;

Data dlist[HASH_M];	//?????????????´?????????????????????????

int getHashAddr(char str[STR_SIZE], int M, int a){
	int i = 0, h = 0;
	if( M <= 0 ){ M = HASH_M; }
	if( a <= 0 ){ a = HASH_A; }
	for( i = 0; str[i] != '\0'; i++ ){ h = (a*h + str[i]) % M; }
	return h;
}

void hashShow(int addr){
	Data *tmp = &dlist[addr];
	printf("addr=%d\n", addr);
	if( tmp == NULL ){ return; }
	while( tmp->next != NULL ){
		tmp = tmp->next;
		printf("%s\n", tmp->str);
	}
	return;
}

void hashAdd(char str[STR_SIZE]){
	int addr = getHashAddr(str, HASH_M, HASH_A);
	Data *data = (Data*)malloc(sizeof(Data));
	strcpy(data->str, str);
	data->next = NULL;
	Data *tmp = &dlist[addr];
	while( tmp->next != NULL ){ tmp = tmp->next; }
	tmp->next = data;
	//hashShow(addr);
	return;
}

void hashRemove(char str[STR_SIZE]){
	int addr = getHashAddr(str, HASH_M, HASH_A);
	Data *tmp = &dlist[addr];
	Data *target;
	while( tmp->next != NULL ){
		if( strcmp(tmp->next->str, str) == 1 ){
			target = tmp->next;
			tmp->next = tmp->next->next;
			free(target);
			return;
		}
	}
	return;
}

int hashFind(char str[STR_SIZE]){
	int addr = getHashAddr(str, HASH_M, HASH_A);
	Data *tmp = &dlist[addr];
	while( tmp->next != NULL ){
		tmp = tmp->next;
		if( strcmp(tmp->str, str) == 0 ){ return 1; }
	}
	return 0;
}

int main(){
	int n, i;
	char com[128], str[STR_SIZE];
	Data dummy;
	dummy.next = NULL;
	dummy.str[0] = '\0';
	for( i = 0; i < HASH_M; i++ ){ dlist[i] = dummy; }
	scanf("%d", &n);
	for( i = 0; i < n; i++ ){
		scanf("%s %s", com, str);
		if( strcmp(com, "add\0") == 0 ){
			hashAdd(str);
		}else if( strcmp(com, "remove\0") == 0 ){
			hashRemove(str);
		}else if( strcmp(com, "find\0") == 0 ){
			printf("%s\n", (hashFind(str)?"yes":"no"));
		}else{
			printf("it is not command\n");
		}
	}
	return 0;
}