#include <bits/stdc++.h>
using namespace std;
int const size = (1e5 + 7) * 2;
int dj[size];
int djsize[size];
bool visit[size];
int u, v, w;
void djinit() {
  for (int x = 0; x < size; x++) dj[x] = x;
  for (int x = 0; x < size; x++) djsize[x] = 1;
}
int find(int i) {
  if (dj[i] == i) return i;
  dj[i] = find(dj[i]);
  return dj[i];
}
void djunion(int i, int j) {
  int root1 = find(i);
  int root2 = find(j);
  if (root1 != root2) {
    if (djsize[root1] < djsize[root2]) {
      djsize[root2] += djsize[root1];
      dj[root1] = dj[root2];
    } else {
      djsize[root1] += djsize[root2];
      dj[root2] = dj[root1];
    }
  }
}
int main() {
  string a, b;
  cin >> a;
  b = a;
  sort(b.begin(), b.end());
  if (a != b) {
    cout << "NO";
    return 0;
  }
  int arr[3] = {0};
  for (char x : a) arr[x - 'a']++;
  if (arr[0] == 0 || arr[1] == 0) {
    cout << "NO";
    return 0;
  }
  if (arr[2] == 0 || (arr[0] != arr[2] && arr[1] != arr[2])) {
    cout << "NO";
    return 0;
  }
  cout << "YES";
  return 0;
}
