import sys

line = sys.stdin.readline().strip()
# print(line)

def check(line):
    ns = line.count("a"), line.count("b"), line.count("c")
    ns = sorted(ns)
    m = min(ns)
    ns = ns[0] - m, ns[1] - m, ns[2] - m
    # print(ns, m)
    return ns[2] < 2

if check(line):
    print("YES")
else:
    print("NO")
