#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define LINF 1e18
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const double PI = acos(-1.0);
const double EPS = 1e-10;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    string S;
    cin>>S;
    N = S.size();

    map<char,int> mp;
    REP(i,N) mp[S[i]]++;
    if(N==1){
        cout<<"NO"<<endl;
    }
    else if(N==2){
        if(S[0]==S[1]) cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
    }
    else{
        int ma,mi;
        int a,b,c;
        for(auto x:mp){
            if(x.first=='a') a=x.second;
            else if(x.first=='b') b=x.second;
            else c=x.second;
        }
        ma = max({a,b,c});
        mi = min({a,b,c});

        if(ma>=N-1){
            cout<<"NO"<<endl;
            return 0;
        }
        int flg = (a>=N-2) + (b>=N-2) + (c>=N-2);
        if(flg >= 2){
            cout<<"NO"<<endl;
        }
        else{
            if(N%2==1){
                if(mi==1 && ma==((N-1)/2)) cout<<"NO"<<endl;
                else cout<<"YES"<<endl;
            }
            else cout<<"YES"<<endl;
    }
}
