#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int dir4[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
const int dir8[8][2] = {{1, 0}, {0, 1},   {-1, 0}, {0, -1},
                        {1, 1}, {-1, -1}, {1, -1}, {-1, 1}};
const int dir63[6][3] = {{0, 0, 1},  {0, 0, -1}, {0, 1, 0},
                         {0, -1, 0}, {1, 0, 0},  {-1, 0, 0}};
const int daym[2][13] = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
                         {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
const int MAXN = 1000010;
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }
int nine[2][13] = {{0, 3, 2, 3, 3, 3, 3, 3, 3, 33, 3, 3, 3},
                   {0, 3, 3, 3, 3, 3, 3, 3, 3, 33, 3, 3, 3}};
char s[5555];
int main() {
  scanf("%s", s);
  int len = strlen(s);
  int a, b, c;
  a = b = c = 0;
  for (int i = 0; i < len; i++) {
    if (s[i] == 'a' && b == 0 && c == 0) {
      a++;
    } else if (s[i] == 'b' && a && c == 0) {
      b++;
    } else if (s[i] == 'c' && a && b) {
      c++;
    } else {
      a = 0x3f3f3f3f;
      break;
    }
  }
  if (a != 0x3f3f3f3f) {
    if ((c == a || c == b) && (a != 0) && (b != 0) && (c != 0)) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
