unittest
{
	assert( [ "abac" ].parse.expand.solve == "YES" );
	assert( [ "aba" ].parse.expand.solve == "NO" );
	assert( [ "babacccabab" ].parse.expand.solve == "YES" );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto s = input.front.to!( dchar[] );
	return tuple( s );
}

auto solve( dchar[] s )
{
	auto cs = new long[ 3 ];
	foreach( c; s )
	{
		cs[ c - 'a' ]++;
	}
	cs.sort();
	return ( cs[ 2 ] - cs[ 0 ] <= 1 ) ? "YES" : "NO";
}
