#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  map<char, int> mp;
  for(int i=0;i<s.size();i++){
    mp[s[i]]++;
  }
  if(s.size()==1){
    cout << "YES\n";
    return 0;
  }
  if(abs(mp['a']-mp['b'])<=1 and abs(mp['a']-mp['c'])<=1 and abs(mp['c']-mp['b'])<=1 ){
    cout << "YES\n";
  }else{
    cout << "NO\n";
  }
  return 0;
}
