n = gets.to_i
dic = Hash.new( )
output = []
n.times {
	cmd, word = gets.split( " " )
	if "insert" == cmd
		dic[ word ] = true
	elsif "find" == cmd
		if dic[ word ]
			output.push( "yes" )
		else
			output.push( "no" )
		end
	end
}
puts( output.join( "\n" ) )