#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
#define mem(a,b) memset((a),(b),sizeof(a))
#define MP make_pair
#define pb push_back
#define fi first
#define se second
#define sz(x) x.size()
#define all(x) x.begin(),x.end()
using namespace std;
#define _GLIBCXX_PERMIT_BACKWARD_HASH
#include <ext/hash_map>
using namespace __gnu_cxx;
struct str_hash{size_t operator()(const string& str)const{return __stl_hash_string(str.c_str());}};
typedef long long ll;
typedef unsigned long long ull;
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDD pair<double,double>
const int INF=0x3f3f3f3f;
const ll LLINF=0x3f3f3f3f3f3f3f3f;
const double PI=acos(-1.0);
const double eps=1e-6;
const int MAX=1e5+10;
const ll mod=1e9+7;
char s[MAX];
int main()
{
	int i,len,a[5],flag;
	while(~scanf("%s",s))
	{
		len=strlen(s);
		mem(a,0);
		for(i=0;i<len;i++)
		{
			a[s[i]-'a']++;
		}
		flag=0;
		if(len==1)
		{
			puts("YES");
			continue;
		}
		else if(len==2)
		{
			if(a[0]<2&&a[1]<2&&a[2]<2) puts("YES");
			else puts("NO");
			continue;
		}
		for(i=0;i<len;i++)
		{
			if(i%3==0)
			{
				if(!a[0]) flag=1;
				a[0]--;
			}
			else if(i%3==1)
			{
				if(!a[1]) flag=1;
				a[1]--;
			}
			else if(i%3==2)
			{
				if(!a[2]) flag=1;
				a[2]--;
			}
		}
		if(flag) puts("NO");
		else puts("YES");
	}
	return 0;
}