S = input()
nums = [S.count(x) for x in 'abc']
nums.sort()

def check():
    if nums[-1] - nums[-2] > 1:
        return False
    if nums[-2] - nums[-3] > 1:
        return False
    if nums[1] == 0 and nums[-1] > 1:
        return False
    if nums[0] == 0 and nums[-1] - nums[-2] > 0:
        return False
    return True

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