S = input()
d = {a: 0 for a in 'abc'}
for x in S:
    d[x] += 1

if len(S) == 1 or (len(S) == 2 and max(d.values()) == 1) or (len(S) >= 3 and max(d.values()) - min(d.values()) <= 1):
    print('YES')
else:
    print('NO')