def b_palindrome_phobia(S):
    a_cnt = S.count('a')
    b_cnt = S.count('b')
    c_cnt = S.count('c')
    count = [a_cnt, b_cnt, c_cnt]
    ans = 'YES' if max(count) - min(count) <= 1 else 'NO'
    return ans

S = input().strip()
print(b_palindrome_phobia(S))