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

#define WordLength 13
#define DictionarySize 1000000

#define M 97

#define Base 256

struct ALDS1_4_C{
	
	char word[WordLength];
	short isAvail;
	
};
typedef struct ALDS1_4_C ALDS;


void insert(char string[]);
int find(char string[]);
int hash(char string[]);
int power(int value, int n);



ALDS dic[DictionarySize];

int main(void){
	
	int i, n;
	char order[10], string[WordLength];
	
	for(i=0; i<DictionarySize; i++){
		
		dic[i].isAvail = 0;
		
	}
	
	
	scanf("%d", &n);
	
	
	for(i=0; i<n; i++){
		
		scanf("%s %s", order, string);
		
		
		//do insert
		if(order[0] == 'i'){
			
			insert(string);
			
		}
		
		//do find
		else{
			
			if(find(string) == 1){
				
				printf("yes\n");
				
			}
			else{
				
				printf("no\n");
				
			}
			
		}
		
		
	}
	
	
	return 0;
	
}




void insert(char string[]){
	
	int idx = hash(string) % M;
	int i = idx;
	
	//printf("idx = %d\n", idx);
	
	if(dic[idx].isAvail == 0){
		
		strcpy(dic[idx].word, string);
		dic[idx].isAvail = 1;
		
	}
	else{
		
		while(dic[--i].isAvail == 1 && i >= 0);
		
		if(dic[i].isAvail == 0){
			
			strcpy(dic[i].word, string);
			dic[i].isAvail = 1;
			
		}
		else if(i < 0){
			
			i = idx;
			while(dic[++i].isAvail == 1 && i < DictionarySize);
			
			if(dic[i].isAvail == 0){
				
				strcpy(dic[i].word, string);
				dic[i].isAvail = 1;
				
			}
			else{
				
				//エラーメッセージ;
				//printf("辞書に空きがありません。\n");
				
			}
			
		}
		
		
	}
	
}



int find(char string[]){
	
	int idx = hash(string) % M;
	int ret = 0;
	int i = idx;
	
	//printf("idx = %d\n", idx);
	
	while(dic[i].isAvail == 1 && i >= 0){
		
		if(strcmp(string, dic[i].word) == 0){
			
			ret = 1;
			break;
			
		}
		
		i--;
		
	}
	
	if(ret == 0){
		
		i = idx+1;
		
		while(dic[i].isAvail == 1 && i < DictionarySize){
			
			if(strcmp(string, dic[i].word) == 0){
				
				ret = 1;
				break;
				
			}
			
			i++;
			
		}
		
	}
	
	return ret;
	
}



int hash(char string[]){
	
	int i;
	int ret = 0;
	int length = strlen(string);
	
	//printf("string = \"%s\"\n", string);
	
	for(i=0; i<length; i++){
		
		//printf("ret = %d\n", ret);
		//Sleep(1500);
		
		ret += ((int)string[i] * power(Base, length-i-1)) % M;
		
	}
	
	return ret;
	
}


int power(int value, int n){
	
	int ret = value;
	
	//printf("value = %d\n", value);
	
	while(n > 1){
		
		ret *= value;
		n--;
		
	}
	
	return ret;
	
}