Snuke has a string S consisting of three kinds of letters: `a`, `b` and `c`.  He has a phobia for palindromes, and wants to permute the characters in S so that S will not contain a palindrome of length 2 or more as a substring. Determine whether this is possible.
# coding: utf-8
# Your code here!
S=list(input())

l=[0,0,0]
for i in range(len(S)):
    if S[i]=="a":
        l[0]+=1
    elif S[i]=="b":
        l[1]+=1
    else:
        l[2]+=1

temp=max(l)

if temp>(len(S)/2):
    print("No")
else:
    print("Yes")

# coding: utf-8
# Your code here!
S=list(input())

l=[0,0,0]
for i in range(len(S)):
    if S[i]=="a":
        l[0]+=1
    elif S[i]=="b":
        l[1]+=1
    else:
        l[2]+=1

temp=min(l)
for i in range(3):
    l[i]-=temp
    
#print(l)
if (l[0]*l[1]*l[2]==0) and (l[0]>1 or l[1]>1 or l[2]>1):
    print("NO")
else:
    print("YES")
