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

#define U1 unsigned char
#define S1 char
#define	S4 int
#define U4 unsigned int
#define VD void

#define TRUE (1)
#define FALSE (0)

#define MAX_COMMAND_LENGTH  (7)				/* \0を含めた最長のコマンドの文字数 */
#define MAX_STR_LENGTH		(13)			/* \0を含めた辞書に登録する最長の文字列 */
#define MAX_ELM_DICTIONARY	(1000000)		/* 辞書の登録数 */

typedef struct st_dictionary {
	U1 u1_p_dictionary[MAX_ELM_DICTIONARY][MAX_STR_LENGTH];
	U4 u4_elmDictionary;
}ST_DICTIONARY;

static ST_DICTIONARY st_s_dictionary;

S4 main()
{
	U1 u1_t_delimiter;
	S4 s4_t_numCommand;
	S4 s4_t_cntCommand;
	S4 s4_t_cnt;
	U1 u1_tp_command[MAX_COMMAND_LENGTH];
	U1 u1_tp_str[MAX_STR_LENGTH];
	S4 s4_t_strcmpResult;
	U1 u1_t_isFind;


	st_s_dictionary.u4_elmDictionary = (U4)0;

	scanf("%d%c", &s4_t_numCommand, &u1_t_delimiter);

	for (s4_t_cntCommand = (S4)0; s4_t_cntCommand < s4_t_numCommand; s4_t_cntCommand++)
	{
		/* コマンドと文字列の入力 */
		scanf("%s %s%c", &u1_tp_command[0], &u1_tp_str[0], &u1_t_delimiter);

		/* コマンドの判定 */
		s4_t_strcmpResult = (S4)strcmp(&u1_tp_command[0], "insert");
		if (s4_t_strcmpResult == (S4)0)
		{
			strcpy(st_s_dictionary.u1_p_dictionary[st_s_dictionary.u4_elmDictionary], &u1_tp_str[0]);
			st_s_dictionary.u4_elmDictionary++;
		}
		else {
			s4_t_strcmpResult = (S4)strcmp(&u1_tp_command[0], "find");
			if (s4_t_strcmpResult == (S4)0)
			{
				/* 辞書の全要素を愚直に探索。既定の計算時間にも間に合うはず。 */
				u1_t_isFind = (U1)FALSE;
				s4_t_cnt = (S4)0;
				while((s4_t_cnt < (S4)st_s_dictionary.u4_elmDictionary) &&
					  (u1_t_isFind != (U1)TRUE))
				{
					s4_t_strcmpResult = strcmp(st_s_dictionary.u1_p_dictionary[s4_t_cnt], u1_tp_str);
					if (s4_t_strcmpResult == (S4)0)
					{
						u1_t_isFind = (U1)TRUE;
					}
					s4_t_cnt++;
				}

				if (u1_t_isFind == (U1)TRUE)
				{
					printf("yes\n");
				}
				else {
					printf("no\n");
				}
			}
		}
	}

	return((S4)0);
}

