#include <bits/stdc++.h>
using namespace std;
int num[30];
int main() {
  int len;
  string s;
  cin >> s;
  len = s.size();
  for (int i = 0; i < len; i++) num[s[i] - 'a']++;
  if (len == 2) {
    for (int i = 0; i < 26; i++) {
      if (num[i] >= 2) {
        cout << "NO" << endl;
        return 0;
      }
    }
  } else if (len == 3) {
    for (int i = 0; i < 26; i++) {
      if (num[i] >= 2) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  while (1) {
    int cnt = 0;
    for (int i = 0; i < 26; i++) {
      if (num[i] > 0) {
        cnt++;
        num[i]--;
      }
      if (cnt == 3) break;
    }
    if (cnt != 3) break;
  }
  for (int i = 0; i < 26; i++) {
    if (num[i] >= 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
