using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;

namespace TestApp2
{
    class Program
    {
        static void Main()
        {
            var str = Console.ReadLine();
            var aCount = str.Count(x => x == 'a');
            var bCount = str.Count(x => x == 'b');
            var cCount = str.Count(x => x == 'c');
            var len = str.Length;
            if (len == 1)
            {
                Console.WriteLine("NO");
            }
            else if(len ==2)
            {
                if (str == "aa" || str == "bb" || str == "cc")
                {
                    Console.WriteLine("NO");
                }
                else
                {
                    Console.WriteLine("YES");
                }
            }
            else
            {
                if (aCount * bCount * cCount == 0)
                    Console.WriteLine("NO");
                else
                {
                    var tinko = len / 3;
                    if (tinko<= aCount && tinko <= bCount && tinko <= cCount)
                    {
                        Console.WriteLine("YES");
                    }
                    else
                    {
                        Console.WriteLine("NO");
                    }
                }
            }
            Console.ReadLine();
        }
    }

}