#include <bits/stdc++.h>
using namespace std;
int a, b, c;
char d[100001];
int main() {
  string s;
  cin >> s;
  int l = s.length();
  for (int i = 0; i < l; i++)
    if (s[i] == 'a')
      a++;
    else if (s[i] == 'b')
      b++;
    else if (s[i] == 'c')
      c++;
  for (int i = 0; i < l; i++) {
    bool boa = 1, bob = 1, boc = 1;
    if (i > 1)
      if (d[i - 2] == 'a')
        boa = 0;
      else if (d[i - 2] == 'b')
        bob = 0;
      else if (d[i - 2] == 'c')
        boc = 0;
    if (i)
      if (d[i - 1] == 'a')
        boa = 0;
      else if (d[i - 1] == 'b')
        bob = 0;
      else if (d[i - 1] == 'c')
        boc = 0;
    if (!boa && !bob && !boc) {
      puts("NO");
      return 0;
    }
    int mx = 0;
    char o;
    if (boa && a > mx) mx = a, o = 'a';
    if (bob && b > mx) mx = b, o = 'b';
    if (boc && c > mx) mx = c, o = 'c';
    d[i] = o;
    if (o == 'a') a--;
    if (o == 'b') b--;
    if (o == 'c') c--;
    if (a < 0 || b < 0 || c < 0) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  return 0;
}
