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

#define D 4

struct LIST{
	char data[13];
	struct LIST *left,*right;
};

int convert(char s){
	if(s=='A'){
		return 0;
	}else if(s=='C'){
		return 1;
	}else if(s=='G'){
		return 2;
	}else{
		return 3;
	}
}

int show(struct LIST *L){
	
	if(L==NULL){return 0;}

	printf("%s\n",L->data);
	show(L->left);
	show(L->right);
	
	return 0;
}

void insert(struct LIST *L,char data[]){
	struct LIST *add=(struct LIST*)malloc(sizeof(struct LIST));
	strcpy(add->data,data);
	add->left=NULL;
	add->right=NULL;
	
	while(1){
		if(strcmp(L->data,data)==NULL){break;}

		if(strcmp(data,L->data)<0){
			if(L->left==NULL){
				L->left=add;
				break;
			}
			L=L->left;
		}else{
			if(L->right==NULL){
				L->right=add;
				break;
			}
			L=L->right;
		}
	}
}

void find(struct LIST *L,char data[]){
	while(L!=NULL){
		if(strcmp(L->data,data)==0){
			printf("yes\n");
			break;
		}

		if(strcmp(data,L->data)<0){
			L=L->left;
		}else{
			L=L->right;
		}
		if(L==NULL){
			printf("no\n");
		}
	}
}

int main(){
	int n;
	char command[13],data[13];
	struct LIST L;

	strcpy(L.data,"E");
	L.left=NULL;
	L.right=NULL;
	
	scanf("%d",&n);

	for(int i=0;i<n;i++){
		scanf("%s %s",command,data);
		if(strcmp(command,"insert")==0){
			insert(&L,data);
		}else{
			find(&L,data);
		}
		//show(&L);
	}

	return 0;
}
