#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, s1, s2, s3, s4, s5, s6;
  s1 = "ABC";
  s2 = "ACB";
  s3 = "BCA";
  s4 = "BAC";
  s5 = "CAB";
  s6 = "CBA";
  cin >> s;
  if (s.find(s1) != std::string::npos) {
    cout << "YES" << endl;
  } else if (s.find(s2) != std::string::npos) {
    cout << "YES" << endl;
  } else if (s.find(s3) != std::string::npos) {
    cout << "YES" << endl;
  } else if (s.find(s4) != std::string::npos) {
    cout << "YES" << endl;
  } else if (s.find(s5) != std::string::npos) {
    cout << "YES" << endl;
  } else if (s.find(s6) != std::string::npos) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
