#include <bits/stdc++.h>
using namespace std;
string x;
int a, b, c;
int main() {
  cin >> x;
  for (a = 0; a < x.length() and x[a] == 'a'; a++)
    ;
  for (b = a; b < x.length() and x[b] == 'b'; b++)
    ;
  for (c = b; c < x.length() and x[c] == 'c'; c++)
    ;
  puts((a and b - a and c - b and c == x.length() and
        (c - b == a or c - b == b - a))
           ? "YES"
           : "NO");
  return 0;
}
