#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
inline void multiply(long long mat1[][2], long long mat2[][2]) {
  long long res[2][2];
  long long i, j, k;
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 2; j++) {
      res[i][j] = 0;
      for (k = 0; k < 2; k++)
        res[i][j] = (res[i][j] + (mat1[i][k] * mat2[k][j])) % mod;
    }
  }
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 2; j++) mat1[i][j] = res[i][j];
  }
}
inline long long moduloexp(long long l, long long p) {
  long long res = 1;
  while (p > 0) {
    if (p % 2 == 1) {
      res *= l;
      res %= mod;
    }
    p /= 2;
    l = (l * l) % mod;
  }
  return res;
}
inline long long modInverse(long long l, long long power, long long mod) {
  l = moduloexp(l, power);
  return moduloexp(l, mod - 2);
}
inline void fs(long long &number) {
  bool negative = false;
  register long long c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
int main() {
  string p;
  int i, j, t = 0;
  cin >> p;
  string s[6];
  s[0] = "ABC";
  s[1] = "ACB";
  s[2] = "BAC";
  s[3] = "BCA";
  s[4] = "CAB";
  s[5] = "CBA";
  for (i = 0; i < 6; i++) {
    size_t found = p.find(s[i]);
    if (found != std::string::npos) {
      t = 1;
      cout << "Yes";
      break;
    }
  }
  if (t == 0) cout << "No";
}
