S = input().strip()
C = {"a":0,"b":0,"c":0}
for i in range(len(S)):
    C[S[i]] += 1
cmin = min(C["a"],C["b"],C["c"])
for x in C:
    C[x] -= cmin
cmax = max(C["a"],C["b"],C["c"])
if cmax<=1:
    print("YES")
else:
    print("NO")