<?php
fscanf(STDIN, "%s", $str);

$len = strlen($str);
$a_count = mb_substr_count($str, 'a');
$b_count = mb_substr_count($str, 'b');
$c_count = mb_substr_count($str, 'c');

if ($len >= 3 * $a_count - 2
   and $len >= 3 * $b_count - 2
   and $len >= 3 * $c_count - 2) {
	echo 'YES';
} else {
	echo 'NO';
}