#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
using LL = long long;
const LL LINF = 1e18;
const double EPS = 1e-10;
using namespace std;
class PalseError {};
class Edge {
 public:
  int from, to, value;
  Edge(LL a, LL b, LL c) {
    from = a;
    to = b;
    value = c;
  }
  Edge(LL a, LL b) {
    from = a;
    to = b;
  }
};
string generate(string second) {}
bool check(string str) {
  for (int a = 0; a < min((int)str.size() - 2, 0); a++) {
    string second = str.substr(a, 3);
    if (!((second.at(0) != second.at(1) && second.at(1) != second.at(2) &&
           second.at(0) != second.at(2))))
      return false;
  }
  return true;
}
int main() {
  string(str);
  cin >> (str);
  int countA = count((str).begin(), (str).end(), 'a');
  int countB = count((str).begin(), (str).end(), 'b');
  int countC = count((str).begin(), (str).end(), 'c');
  string per = "abc";
  do {
    int ins_a = countA;
    int ins_b = countB;
    int ins_c = countC;
    string ins;
    while (ins_a != 0 || ins_b != 0 || ins_c != 0) {
      for (int index = 0; index < 3; index++) {
        if (per.at(index) == 'a') {
          if (ins_a >= 1) {
            ins.push_back('a');
            ins_a--;
          }
        } else if (per.at(index) == 'b') {
          if (ins_b >= 1) {
            ins.push_back('b');
            ins_b--;
          }
        } else if (per.at(index) == 'c') {
          if (ins_c >= 1) {
            ins.push_back('c');
            ins_c--;
          }
        }
      }
    }
    if (check(ins)) {
      cout << ((1) ? "YES" : "NO") << endl;
      return 0;
    }
  } while (next_permutation((per).begin(), (per).end()));
  cout << ((0) ? "YES" : "NO") << endl;
  return 0;
}
