from sys import stdin

from itertools import groupby



s = list(stdin.readline().rstrip())

s.sort()

li = []

for key, value in groupby(s):

    li.append(len(list(value)))

if len(li) == 1:

    li += [0]*2

elif len(li) == 2:

    li += [0]



if abs(li[2]-li[1]) <= 1 and abs(li[1]-li[0]) <= 1 and abs(li[2]-li[0]) <= 1:

    print("YES")

else:

    print("NO")
from sys import stdin

from sys import setrecursionlimit

setrecursionlimit(10 ** 7)



from collections import Counter



s = eval(input())

C = Counter(s)



a = C["a"]

b = C["b"]

c = C["c"]



li = [a,b,c]

li.sort()



if li[0]+1 >= li[2]:

    print("YES")

else:

    print("NO")
from sys import stdin
from itertools import groupby

s = list(stdin.readline().rstrip())
s.sort()
li = []
for key, value in groupby(s):
    li.append(len(list(value)))
if len(li) == 1:
    li += [0] * 2
elif len(li) == 2:
    li += [0]
if abs(li[2] - li[1]) <= 1 and abs(li[1] - li[0]) <= 1 and abs(li[2] - li[0]) <= 1:
    print("YES")
else:
    print("NO")

from sys import stdin
from sys import setrecursionlimit

setrecursionlimit(10**7)
from collections import Counter

s = eval(input())
C = Counter(s)
a = C["a"]
b = C["b"]
c = C["c"]
li = [a, b, c]
li.sort()
if li[0] + 1 >= li[2]:
    print("YES")
else:
    print("NO")

-from itertools import groupby +from sys import setrecursionlimit -s = list(stdin.readline().rstrip()) -s.sort() -li = [] -for key, value in groupby(s): -    li.append(len(list(value))) -if len(li) == 1: -    li += [0] * 2 -elif len(li) == 2: -    li += [0] -if abs(li[2] - li[1]) <= 1 and abs(li[1] - li[0]) <= 1 and abs(li[2] - li[0]) <= 1: +setrecursionlimit(10**7) +from collections import Counter + +s = eval(input()) +C = Counter(s) +a = C["a"] +b = C["b"] +c = C["c"] +li = [a, b, c] +li.sort() +if li[0] + 1 >= li[2]: