#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int kind = 0;
  map<char, int> a;
  for (int i = 0; i < str.size(); i++) {
    if (a.count(str[i]) == 0) {
      a[str[i]] = 1;
      kind++;
    }
  }
  if (kind == 3 || (kind == 2 && str.size() == 2) || str.size() == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
