s=input()
count=[0,0,0]
for i in range(len(s)):
    count[(int)(s[i]-'a')]+=1
if abs(count[0]-count[1])<2 and abs(count[0]-count[2])<2 and abs(count[1]-count[2])<2:
    print('YES',end='')
else:
    print('NO',end='')
