S = input()
count = []

count.append(S.count('a'))
count.append(S.count('b'))
count.append(S.count('c'))

max = max(count)
min = min(count)

if count.count(max) == 2:
    if min == max-1:
        print ("YES")
    else :
        print("NO")
elif count.count(min) == 2:
    if min == max-1:
        print ("YES")
    else :
        print("NO")
elif max == min:
    print ("YES")
else:
    print("NO")