#include <bits/stdc++.h>
using namespace std;
int main() {
  string input;
  cin >> input;
  string str;
  vector<string> A = {"BAC", "BCA", "ABC", "ACB", "CAB", "CBA"};
  if (input.size() < 3) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 0; i < input.size() - 2; ++i) {
    str = input.substr(i, 3);
    for (auto a : A) {
      if (a == str) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
