s = input()
a, b, c = 0, 0, 0
for i in s:
    if i == 'a':
        a += 1
    elif i == 'b':
        b += 1
    else:
        c += 1

flag = True
if (a + b == 0) or (b + c == 0) or (c + a == 0):
    if a + b + c != 1:
        flag = False
elif a * b * c == 0:
    if a + b + c != 2:
        flag = False
else:
    mn = min(a, b, c)
    mx = max(a, b, c)
    if mx - mn > 1:
        flag = False

print('YES' if flag else 'NO')
