def main():
    S = input()
    a = S.count("a")
    b = S.count("b")
    c = S.count("c")
    diff = max((a, b, c)) - min((a, b, c))
    if diff <= 1:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    main()
