from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())


S = input()
cnt = [0]*3
for s in S:
    if s == 'a':
        cnt[0] += 1
    elif s == 'b':
        cnt[1] += 1
    elif s == 'c':
        cnt[2] += 1

if max(cnt)-min(cnt) <= 1:
    print('YES')
else:
    print('NO')
