S = input()

L = []
L.append(S.count("a"))
L.append(S.count("b"))
L.append(S.count("c"))
L = sorted(L)

if (L[0] == 0) and (L[1] != 0) :
    if len(S) % 2 :
        print("NO")
    else :
        print("YES")
elif L[1] == 0 :
    print("NO")
else :
    if L[0] + L[1] < L[2] :
        print("NO")
    else :
        print("YES")
        
    