#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  bool seenA = 0, seenB = 0, seenC = 0;
  int cntA = 0, cntB = 0, cntC = 0;
  for (int i = 0; s[i]; i++) {
    if (s[i] == 'a') {
      seenA = 1;
      cntA++;
      if (seenB || seenC) return cout << "NO", 0;
    }
    if (s[i] == 'b') {
      seenB = 1;
      cntB++;
      if (!seenA || seenC) return cout << "NO", 0;
    }
    if (s[i] == 'c') {
      seenC = 1;
      cntC++;
      if (!seenA || !seenB) return cout << "NO", 0;
    }
  }
  if (seenA && seenB && seenC && (cntA == cntC || cntB == cntC))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
