#include <iostream>
#include <algorithm>
using namespace std;

int main(){
    string S;
    cin >> S;
    int alphabets[3] = {0, 0, 0};
    for(int i = 0; i < S.size(); i++){
        alphabets[S[i] - 'a']++;
    }
    sort(alphabets, alphabets + 3);
    if(alphabets[2] - alphabets[0] <= 1){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
}
