#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	string s;
	cin >> s;
	const int n = s.size();
	vector<int> h(3);
	for(int i = 0; i < n; ++i){ ++h[s[i] - 'a']; }
	const int t = n / 3;
	bool answer = true;
	for(int i = 0; i < 3; ++i){
		if(h[i] != t && h[i] != t + 1){ answer = false; }
	}
	cout << (answer ? "YES" : "NO") << endl;
	return 0;
}

