#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = int(1e9);
const int MAX = 200;
int num[MAX], mixt[MAX];
int n;
bool substring(string &a, string &b) {
  for (int i = 0; i < n; i++) {
    bool found = true;
    for (int j = 0; j < 3; j++) {
      if (a[i + j] != b[j]) {
        found = false;
      }
    }
    if (found) {
      return true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  n = s.size();
  string t = "ABC";
  do {
    if (substring(s, t)) {
      cout << "Yes\n";
      return 0;
    }
  } while (next_permutation(t.begin(), t.end()));
  cout << "No\n";
  return 0;
}
