#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from collections import Counter

def main():
    S = input()

    cnt = Counter()
    for c in "abc":
        cnt[c] = 0
    cnt.update(S)

    v = sorted(cnt.values())
    ok = v[2] - v[0] <= 1
    print("YES" if ok else "NO")

if __name__ == "__main__": main()
