#include <bits/stdc++.h>
using namespace std;
void useFileInput() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
void setMyPrecision(int n) { cout << fixed << setprecision(n); }
bool test = 0;
bool fileInput = 0;
bool found(string flw) {
  return (flw == "ABC" || flw == "ACB" || flw == "BAC" || flw == "BCA" ||
          flw == "CAB" || flw == "CBA");
}
void solve() {
  string landscaape;
  cin >> landscaape;
  if (landscaape.length() < 3) {
    cout << "No";
    return;
  }
  string tmp = "";
  tmp += landscaape[0];
  tmp += landscaape[1];
  tmp += landscaape[2];
  if (landscaape.length() == 3) {
    if (found(tmp)) {
      cout << "Yes";
      return;
    }
  }
  for (int i = 1; i <= landscaape.length() - 3; i++) {
    if (found(tmp)) {
      cout << "Yes";
      return;
    }
    tmp = tmp.substr(1);
    tmp += landscaape[i + 2];
  }
  if (found(tmp))
    cout << "Yes";
  else
    cout << "No";
}
int main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  if (fileInput) useFileInput();
  if (test) {
    int t;
    cin >> t;
    while (t--) solve();
  } else
    solve();
  return 0;
}
