s=input()
a=0
b=0
c=0
for i in range(len(s)):
    if s[i]=='a':
        a+=1
    if s[i]=='b':
        b+=1
    if s[i]=='c':
        c+=1

if abs(a-b) > 1 or abs(b-c) > 1 or abs(c-a)>1:
    print("NO")
else:
    print("YES")
