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

#define col 14
#define N 1000000

char dic[N][col];

int main(void)
{
	
	int size = 0;
	int i, k, n;
	int isFound;
	char dummy;
	char temp[col*2];
	char order[11];
	char string[col];
	
	scanf("%d%c", &n, &dummy);
	
	for(i=0; i<n; i++){
		
		isFound = 0;
		
		fgets(temp, sizeof(temp), stdin);
		
		sscanf(temp, "%s %s", order, string);
		
		
		if(strcmp(order, "insert") == 0){
			
			//puts("do insert");
			strcpy(dic[size], string);
			size++;
			
		}
		else{
			
			//puts("do find");
			
			for(k=0; k<size; k++){
				
				if(strcmp(dic[k], string) == 0){
					
					isFound = 1;
					break;
					
				}
				
			}
			
			
			if(isFound == 1){
				
				printf("yes\n");
				
			}
			else{
				
				printf("no\n");
				
			}
			
		}
		
	}
	
	return 0;
}