S = list(eval(input()))



lst = [0] * 3

for s in S:

    if s == 'a':

        lst[0] += 1

    elif s == 'b':

        lst[1] += 1

    elif s == 'c':

        lst[2] += 1



if max(abs(lst[0] - lst[1]), abs(lst[1] - lst[2]), abs(lst[2] - lst[0])) >= 2:

    print ('NO')

else:

    print ('YES')
from collections import Counter



lst = list(eval(input()))



c = Counter(lst)



A = c['a']

B = c['b']

C = c['c']



if max(max(A, B), C) - min(min(A, B), C) <= 1:

    print ('YES')

else:

    print ('NO')
S = list(eval(input()))
lst = [0] * 3
for s in S:
    if s == "a":
        lst[0] += 1
    elif s == "b":
        lst[1] += 1
    elif s == "c":
        lst[2] += 1
if max(abs(lst[0] - lst[1]), abs(lst[1] - lst[2]), abs(lst[2] - lst[0])) >= 2:
    print("NO")
else:
    print("YES")

from collections import Counter

lst = list(eval(input()))
c = Counter(lst)
A = c["a"]
B = c["b"]
C = c["c"]
if max(max(A, B), C) - min(min(A, B), C) <= 1:
    print("YES")
else:
    print("NO")

-S = list(eval(input())) -lst = [0] * 3 -for s in S: -    if s == "a": -        lst[0] += 1 -    elif s == "b": -        lst[1] += 1 -    elif s == "c": -        lst[2] += 1 -if max(abs(lst[0] - lst[1]), abs(lst[1] - lst[2]), abs(lst[2] - lst[0])) >= 2: +from collections import Counter + +lst = list(eval(input())) +c = Counter(lst) +A = c["a"] +B = c["b"] +C = c["c"] +if max(max(A, B), C) - min(min(A, B), C) <= 1: +    print("YES") +else: -else: -    print("YES")