def main():
    s = input()

    cnt, k = [0 for i in range(3)], 0
    for i in range(len(s)):
        idx = ord(s[i])-ord('a')
        cnt[idx] += 1
        if cnt[idx] == 1:
            k += 1

    if k <= 2 and k < len(s):
        print("NO")
        return

    over = 0
    for i in range(3):
        if (len(s)+2) // 3 < cnt[i]:
            print("NO")
            break
        elif len(s) // 3 < cnt[i]:
            over += 1
    else:
        if over <= len(s) % 3:
            print("YES")
        else:
            print("NO")


if __name__ == '__main__':
    main()
