local s = io.read()
local n = #s
local t = {0, 0, 0}
local sstr = ""
for i = 1, n do
  sstr = s:sub(i, i)
  if(sstr == "a") then t[1] = t[1] + 1
  elseif(sstr == "b") then t[2] = t[2] + 1
  else t[3] = t[3] + 1 end
end
table.sort(t)
print(t[3] - t[1] <= 1 and "YES" or "NO")
