import sys
import collections
S = input()
count_dict = collections.Counter(S)
Num_A = count_dict["a"]
Num_B = count_dict["b"]
Num_C = count_dict["c"]

if Num_A<Num_B+Num_C:
    print("YES")
    sys.exit()
if Num_B<Num_A+Num_C:
    print("YES")
    sys.exit()
if Num_C < Num_A+Num_B:
    print("YES")
    sys.exit()
print("NO")
