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

#define HASH_SIZE 8388617

typedef struct _node {
	int val;
	struct _node *next;
} node;

void push(node **p, int val)
{
	node *w = (node *)malloc(sizeof(node));
	w->val = val;
	w->next = *p;
	*p = w;
}

void terminate(node **p, int n)
{
	int i;
	node *w1, *w2;

	for (i = 0; i < n; i++)
	{
		w1 = p[i];
		while (w1 != NULL)
		{
			w2 = w1->next;
			free(w1);
			w1 = w2;
		}	
	}
}

int getCode(char *s)
{
	int code = 1;
	int i;
	for (i = 0; s[i] != '\0'; i++)
	{
		s[i] = s[i] & 0x06;
		s[i] = s[i] >> 1;
		code = code << 2;
		code = code | s[i];
	}
	return code;
}


int isInclude(node *p, int val)
{
	while (p != NULL)
	{
		if (p->val == val) break;
		p = p->next;
	}
	
	if (p == NULL) return 0;
	return 1;
	
}
int main()
{
	int i, n, key, code;
	char str[13], order[7];
	node **top = (node **)malloc(sizeof(node *) * HASH_SIZE);
	
	for (i = 0; i < HASH_SIZE; i++) top[i] = NULL;

	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%s%s", order, str);
		code = getCode(str);
		key = code % HASH_SIZE;
		switch (order[0])
		{
		case 'i':
			push(&top[key], code);
			break;
		case 'f':
			if (isInclude(top[key], code)) printf("yes\n");
			else printf("no\n");
			break;
		}
	}

	terminate(top, HASH_SIZE);
	free(top);

	return 0;
}