from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools


import queue
from collections import deque


def main():
    s = list(input())
    count = Counter(s)

    if max(count['a'], count['b'], count['c']) - min(count['a'], count['b'], count['c']) <= 1:
        print('YES')
    else:
        print('NO')




if __name__ == '__main__':
    main()
    # test()

