<?php

$input_str = trim(fgets(STDIN));
$input_len = strlen($input_str);

$palindrome_len = 3;

$has_palindrome = false;
$count_list = ['a' => 0, 'b' => 0, 'c' => 0];
foreach (str_split($input_str) as $value)
{
	$count_list[$value]++;
}

foreach ($count_list as $key => $value)
{
	if ($value <= 0 || 1 > 5 * $value / $input_len)
	{
		echo 'NO';
		return;
	}
}

echo 'YES';

