#include <bits/stdc++.h>
using namespace std;
string s;
int a, b, c, ind;
int main() {
  cin >> s;
  int n = s.length();
  if (s[0] != 'a' || s[n - 1] != 'c') {
    cout << "NO";
    return 0;
  }
  for (int k = 0; k < n; k++) {
    if (s[k] == 'a')
      a++;
    else if (s[k] == 'b')
      b++;
    else if (s[k] == 'c')
      c++;
    if (k != 0) {
      if ((s[k - 1] == 'b' && s[k] == 'a') ||
          (s[k - 1] == 'c' && s[k] == 'a') ||
          (s[k - 1] == 'c' && s[k] == 'b')) {
        ind = 1;
        break;
      }
    }
  }
  if (b == 0 || a == 0 || c == 0 || ind == 1) {
    cout << "NO";
    return 0;
  }
  if (a == c || b == c)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
