<?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)
{
	foreach ($count_list as $key2 => $value2)
	{
		if ($key === $key2)
		{
			continue;
		}

		$rate = 100 * ($count_list[$key] + $count_list[$key2]) / $input_len;
		if ($rate > 80)
		{
			echo 'NO';
			return;
		}
	}
}

echo 'YES';

