#include <iostream>
#include <string>

using namespace std;
int main(){
	string s;
	cin >> s;
	int i,n,a = 0,b = 0, c = 0;
	n = s.size();
	for(i=0;i<n;i++){
		if(s[i]=='a'){
			a++;
		}
		if(s[i]=='b'){
			b++;
		}
		if(s[i]=='c'){
			c++;
		}
	}
	
	int s = max({a,b,c}),t = min({a,b,c});
	if(s==t || s-t==1){
		cout << "YES" << endl;
	}
	cout  << "NO" << endl;
}