def main():
    S = input()

    str_ = {'a': 0, 'b': 0, 'c': 0}
    for s in S:
        str_[s] += 1

    if abs(str_['a'] - str_['b']) < 2 and \
            abs(str_['b'] - str_['c']) < 2 and \
            abs(str_['c'] - str_['a']) < 2:
        print('YES')
    else:
        print('NO')

main()
