# cf17-finalB - Palindrome-phobia

from collections import Counter





def main():

    S = input().rstrip()

    C = list(Counter(S).values())

    flg = [len(C) == 1 and sum(C) == 1]  # e.g. "a"

    flg += [len(C) == 2 and sum(C) == 2]  # "ab"

    flg += [len(C) == 3 and max(C) - min(C) <= 1]  # "abcab"

    print(("YES" if any(flg) else "NO"))





if __name__ == "__main__":

    main()
# cf17-finalB - Palindrome-phobia

def main():

    S = input().rstrip()

    C = [S.count(i) for i in "abc"]

    flg = max(C) - min(C) <= 1

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





if __name__ == "__main__":

    main()
# cf17-finalB - Palindrome-phobia
from collections import Counter


def main():
    S = input().rstrip()
    C = list(Counter(S).values())
    flg = [len(C) == 1 and sum(C) == 1]  # e.g. "a"
    flg += [len(C) == 2 and sum(C) == 2]  # "ab"
    flg += [len(C) == 3 and max(C) - min(C) <= 1]  # "abcab"
    print(("YES" if any(flg) else "NO"))


if __name__ == "__main__":
    main()

# cf17-finalB - Palindrome-phobia
def main():
    S = input().rstrip()
    C = [S.count(i) for i in "abc"]
    flg = max(C) - min(C) <= 1
    print(("YES" if flg else "NO"))


if __name__ == "__main__":
    main()

-from collections import Counter - - -    C = list(Counter(S).values()) -    flg = [len(C) == 1 and sum(C) == 1]  # e.g. "a" -    flg += [len(C) == 2 and sum(C) == 2]  # "ab" -    flg += [len(C) == 3 and max(C) - min(C) <= 1]  # "abcab" -    print(("YES" if any(flg) else "NO")) +    C = [S.count(i) for i in "abc"] +    flg = max(C) - min(C) <= 1 +    print(("YES" if flg else "NO"))