import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

# abcabcab 型が必要

from collections import Counter
S = input().rstrip()
counter = Counter(S)
a = counter['a']
b = counter['b']
c = counter['c']

x = max(a,b,c) - min(a,b,c)

answer = 'YES' if x in [0,1] else 'NO'
print(answer)

