#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.size() < 3) {
    cout << "No";
    return 0;
  }
  for (int i = 0; i < s.size() - 2; i++) {
    string s1 = s.substr(i, 3);
    sort(s1.begin(), s1.end());
    if (s1 == "ABC") {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
