#include <bits/stdc++.h>
const int inf = 1e5 + 10;
using namespace std;
int main() {
  string st;
  cin >> st;
  int flag = 0;
  for (int i = 0; i < st.length(); i++) {
    if (i + 2 < st.length()) {
      string ss = st.substr(i, 3);
      if (ss == "ABC" || ss == "ACB" || ss == "BAC" || ss == "BCA" ||
          ss == "CAB" || ss == "CBA") {
        flag = 1;
      }
    }
  }
  if (flag == 1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
