S=input()
s=len(S)
a=S.count("a")
b=S.count("b")
c=S.count("c")
if s%3==0:
    if max(a,b,c)<=s//3:
        print("YES")
    else:
        print("NO")
if s%3!=0:
    if max(a,b,c)<=s//3+1:
        print("YES")
    else:
        print("NO")