local s=io.read()
local sable={a=0,b=0,c=0}
for i=1,#s do
    s_i=s:sub(i,i)
    sable[s_i]=sable[s_i]+1
end

if math.max(sable.a,sable.b,sable.c)-math.min(sable.a,sable.b,sable.c)<=1 then
    print("YES")
else
    print("NO")
end