#include <bits/stdc++.h>
struct IO {
  static const int L = 1000000;
  char a[L], b[L], *s, *t, *p, c;
  IO() : p(b) {}
  ~IO() { fwrite(b, 1, p - b, stdout); }
  char gc() {
    if (s == t) t = (s = a) + fread(a, 1, L, stdin);
    return *s++;
  }
  void gs(char* st) {
    for (c = gc(); !isgraph(c); c = gc())
      ;
    *st++ = c;
    for (c = gc(); isgraph(c); c = gc()) *st++ = c;
    *st++ = 0;
  }
  template <class T>
  operator T() {
    static T x;
    static bool neg;
    for (c = gc(); c != '-' && !isdigit(c); c = gc())
      ;
    if ((neg = c == '-')) c = gc();
    x = c - '0';
    for (c = gc(); isdigit(c); c = gc()) x = x * 10 + (c - '0');
    return neg ? -x : x;
  }
  void pc(const char ch) {
    if (p == b + L) fwrite(p = b, 1, L, stdout);
    *p++ = ch;
  }
  template <class T>
  void print(T x, const char end = '\n') {
    static char cs[30], *q;
    static T y;
    if (x == 0)
      pc('0');
    else {
      if (x < 0) pc('-'), x = -x;
      for (q = cs; x; x = y) y = x / 10, *q++ = x - y * 10 + '0';
      while (q != cs) pc(*--q);
    }
    if (end) pc(end);
  }
  void ps(const char* st, const char end = '\n') {
    while (*st) pc(*st++);
    if (end) pc(end);
  }
} io;
int main() {
  static int i, n;
  static char a[200], r[3];
  io.gs(a + 1);
  n = strlen(a + 1);
  for ((i) = (2); (i) < (n); ++(i)) {
    r[0] = a[i - 1];
    r[1] = a[i];
    r[2] = a[i + 1];
    std::sort(r, r + 3);
    if (r[0] == 'A' && r[1] == 'B' && r[2] == 'C') {
      io.ps("Yes");
      return 0;
    }
  }
  io.ps("No");
  return 0;
}
