n = int( raw_input( ) )
dic = {}
for i in range( n ):
	cmd, word = raw_input( ).split( " " )
	if "insert" == cmd:
		dic[ word ] = True
	elif "find" == cmd:
		if not dic.get( word ):
			print( "no" )
		else:
			print( "yes" ) n = int( raw_input( ) ) n int( raw_input( ) ) int raw_input( ) raw_input dic = {} dic {} for i in range( n ):
	cmd, word = raw_input( ).split( " " )
	if "insert" == cmd:
		dic[ word ] = True
	elif "find" == cmd:
		if not dic.get( word ):
			print( "no" )
		else:
			print( "yes" ) i range( n ) range n cmd, word = raw_input( ).split( " " ) cmd raw_input( ).split( " " ) ( ).split ( ) raw_input split " " word if "insert" == cmd:
		dic[ word ] = True
	elif "find" == cmd:
		if not dic.get( word ):
			print( "no" )
		else:
			print( "yes" ) "insert" == cmd "insert" cmd dic[ word ] = True dic[ word ] dic word True elif "find" == cmd:
		if not dic.get( word ):
			print( "no" )
		else:
			print( "yes" ) "find" == cmd "find" cmd if not dic.get( word ):
			print( "no" )
		else:
			print( "yes" ) not dic.get( word ) dic.get( word ) dic.get dic get word print( "no" ) print "no" print( "yes" ) print "yes" dic = {} {} dic n = int( raw_input( ) ) int( raw_input( ) ) n cmd, word = raw_input( ).split( " " ) raw_input( ).split( " " ) cmd word = raw_input( ).split( " " ) raw_input( ).split( " " ) word
n = int( raw_input( ) )
dic = {}
for i in range( n ):
	cmd, word = raw_input( ).split( " " )
	if "insert" == cmd:
		dic[ word ] = True
	elif "find" == cmd:
		if not dic.get( word ):
			print( "no" )
		else:
			print( "yes" )