#include <bits/stdc++.h>
using namespace std;
const long long INF = LLONG_MAX - 100;
const long long mod = 1e9 + 7;
const long long MAX_N = 5e5 + 5;
long long dx[] = {-1LL, 0, 1LL, 0}, dy[] = {0, 1LL, 0, -1LL};
vector<long long> prime;
long long inv[MAX_N], fac[MAX_N];
template <class T = long long>
T in() {
  T x;
  cin >> x;
  return (x);
}
inline long long GCD(long long a, long long b) {
  long long c;
  while (b != 0) {
    c = a % b;
    a = b;
    b = c;
  }
  return a;
}
inline long long LCM(long long a, long long b) { return a * b / GCD(a, b); }
inline long long POW(long long a, long long b) {
  long long c = 1LL;
  while (b > 0) {
    if (b & 1LL) {
      c = a * c % mod;
    }
    a = a * a % mod;
    b >>= 1LL;
  }
  return c;
}
inline void _nCr() {
  fac[0] = 1LL;
  for (long long i = 1LL; i < MAX_N; i++) {
    fac[i] = fac[i - 1LL] * i % mod;
  }
  for (long long i = 0; i < MAX_N; i++) {
    inv[i] = POW(fac[i], mod - 2);
  }
}
inline long long nCr(long long n, long long r) {
  return (fac[n] * inv[r] % mod) * inv[n - r] % mod;
}
inline void PRI(long long n) {
  bool a[n + 1LL];
  for (long long i = 0; i < n + 1LL; i++) {
    a[i] = 1LL;
  }
  for (long long i = 2; i < n + 1LL; i++) {
    if (a[i]) {
      prime.push_back(i);
      long long b = i;
      while (b <= n) {
        a[b] = 0;
        b += i;
      }
    }
  }
}
class UnionFind {
 private:
  vector<long long> par;

 public:
  vector<long long> hen;
  UnionFind(long long N) {
    par = vector<long long>(N, -1LL);
    hen = vector<long long>(N, 0);
  }
  long long find(long long x);
  long long size(long long x);
  void unite(long long x, long long y);
  bool same(long long x, long long y);
};
long long UnionFind::find(long long x) {
  if (par[x] < 0)
    return x;
  else
    return par[x] = find(par[x]);
}
long long UnionFind::size(long long x) { return -par[find(x)]; }
void UnionFind::unite(long long x, long long y) {
  x = find(x);
  y = find(y);
  if (size(x) < size(y)) swap(x, y);
  if (x == y)
    hen[x]++;
  else
    hen[x] += hen[y] + 1;
  if (x == y) return;
  par[x] += par[y];
  par[y] = x;
}
bool UnionFind::same(long long x, long long y) {
  x = find(x);
  y = find(y);
  return x == y;
}
signed main() {
  string s;
  cin >> s;
  if (s.size() == 2) {
    if (s[0] == s[1])
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
    return 0;
  }
  long long cnt[3] = {0, 0, 0};
  for (auto x : s) {
    cnt[x - 'a']++;
  }
  bool ok = false;
  for (long long(i) = (0); (i) < (3); (i)++) {
    for (long long(j) = (0); (j) < (3); (j)++) {
      if (i == j) continue;
      long long num[3];
      for (long long(k) = (0); (k) < (3); (k)++) num[k] = cnt[k];
      long long p1 = i, p2 = j;
      if (num[i] > 0 && num[j] > 0) {
        num[i]--;
        num[j]--;
        for (long long(k) = (2); (k) < (s.size()); (k)++) {
          for (long long(l) = (0); (l) < (3); (l)++) {
            if (p1 == l || p2 == l) continue;
            num[l]--;
            p1 = p2, p2 = l;
            break;
          }
        }
        if (num[0] == 0 && num[1] == 0) ok = true;
      }
    }
  }
  if (ok)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
