#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define P(f,x) printf(#x"= %"#f"\n" ,(x))
typedef struct {
	char s[13];
}DICTIONARY;
void Insert(DICTIONARY*,char*);
int Find(DICTIONARY*,char *,int);
int main() {
	DICTIONARY *d;
	int n,i,cnt=0;
	char op[10], str[13],*pt;
	d = (DICTIONARY*)calloc(1000000, sizeof(char));
	fscanf(stdin, "%d", &n),getchar();
	for (i = 0; i < n; i++) {
		memset(op, '\0', sizeof(op));
		memset(str, '\0', sizeof(str));
		fscanf(stdin, "%s %s", op, str);
		pt = str;
		if (strcmp(op, "insert") == 0)Insert(d,pt),cnt++;
		else if (strcmp(op, "find") == 0) {
			if (Find(d,pt,cnt)) puts("yes");
			else puts("no");
		}
	}
	free(d);
	return 0;
}

void Insert(DICTIONARY *d, char *str){
	static int i;
	sprintf((d + i)->s, "%s", str);
	i++;
}
int Find(DICTIONARY *d, char *str, int n) {
	int i;
	for (i = 0; i < n; i++)	if (strcmp((d + i)->s, str) == 0) return 1;
	return 0;
}