import collections
import sys
def ans(Num_A,Num_B,Num_C):
    i = 0
    total = Num_A+Num_B+Num_C
    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:
            return 1
            break
    if i == total:    
        print("YES")
        return 0


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

s_list = {}
if Num_A+Num_B+Num_C ==1 or Num_A+Num_B+Num_C ==2:
    print("YES")
    sys.exit()

if judge ==1 and Num_A >=1 and Num_B >=1 :
    s_list[0] ="a"
    s_list[1] ="b"
    Num_A -= 1
    Num_B -= 1
    judge = ans(Num_A,Num_B,Num_C)
    
if judge ==1 and Num_A >=1 and Num_C >=1:
    s_list[0] ="a"
    s_list[1] ="c"
    Num_A -= 1
    Num_C -= 1
    judge = ans(Num_A,Num_B,Num_C)
    #print("value")
if judge ==1 and Num_B >=1 and Num_A >=1:
    s_list[0] ="b"
    s_list[1] ="a"
    Num_B -= 1
    Num_A -= 1
    judge = ans(Num_A,Num_B,Num_C)
if judge ==1 and Num_B >=1 and Num_C >=1:
    s_list[0] ="b"
    s_list[1] ="c"
    Num_C -= 1
    Num_B -= 1
    judge = ans(Num_A,Num_B,Num_C)
if judge ==1 and Num_C >=1 and Num_B >=1:
    s_list[0] ="c"
    s_list[1] ="b"
    Num_C -= 1
    Num_B -= 1
    judge = ans(Num_A,Num_B,Num_C)
if judge ==1 and Num_C >=1 and Num_A >=1:
    s_list[0] ="c"
    s_list[1] ="a"
    Num_C -= 1
    Num_A -= 1
    judge = ans(Num_A,Num_B,Num_C)
if judge ==1:
    print("NO")


# 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
