a, b, c = 0, 0, 0
s = input()

for i in s:
    if i == "a":
        a += 1
    elif i == "b":
        b += 1
    else:
        c += 1
if max(a,b,c) -  min(a,b,c) <= 1:
    print("YES")
else:
    print("NO")