#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  map<char, int> m;
  for (int i = 0; i < s.length(); i++) {
    m[s[i]]++;
  }
  int flag = 0;
  if (m['a'] > 0 && m['b'] > 0 && m['c'] > 0) {
    if (m['a'] == m['c'] || m['b'] == m['c']) {
      flag = 1;
      int c = 1000000, a = 100000, b = 100000;
      for (int i = 0; i < s.length(); i++) {
        if (s[i] == 'a') a = i;
        if (s[i] == 'b') b = i;
        if (s[i] == 'c') c = i;
        if (s[i] == 'b' && (i < a)) {
          flag = 0;
          break;
        }
        if (s[i] == 'a' && i > b) {
          flag = 0;
          break;
        }
        if ((s[i] == 'a' || s[i] == 'b') && (i > c)) {
          flag = 0;
          break;
        }
      }
    }
  }
  if (flag == 1)
    cout << "YES";
  else
    cout << "NO";
}
