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

s_list = {}
if Num_A !=0:
    s_list[0] ="a"
    Num_A -=1
elif Num_B != 0:
    s_list[0] ="b"
    Num_B -= 1
elif Num_C != 0:
    s_list[0] ="c"
    Num_C -= 1

if Num_A !=0 and s_list[0] !="a":
    s_list[1] ="a"
    Num_A -=1
elif Num_B != 0 and s_list[0] !="b":
    s_list[1] ="b"
    Num_B -= 1
elif Num_C != 0 and s_list[0] !="c":
    s_list[1] ="c"
    Num_C -= 1


i = 0
while Num_A + Num_B + Num_C != 0:
    if s_list[i] != "a" and s_list[i+1] != "a" and Num_A != 0:
        s_list[i+2] = "a"
        Num_A -=1
        i +=1

    elif s_list[i] != "b" and s_list[i+1] != "b" and Num_B != 0:
        s_list[i+2] = "b"
        Num_B -=1
        i +=1    
     
    elif s_list[i] != "c" and s_list[i+1] != "c" and Num_C != 0:
        s_list[i+2] = "c"
        Num_C -=1
        i +=1
    else:
        print("NO")    
        sys.exit()

print("YES")
