#include <bits/stdc++.h>
#pragma optimize("O3")
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 2 * 1e9 + 7;
const int base = 2e5 + 1;
const int MAX = 1e5 + 2;
const double EPS = 1e-9;
const double PI = acos(-1.);
const int MAXN = 2 * 1e6 + 1;
int main() {
  string s;
  cin >> s;
  map<char, int> c;
  c['.'] = 0;
  c['A'] = 0;
  c['B'] = 0;
  c['C'] = 0;
  c[s[0]]++;
  c[s[1]]++;
  c[s[2]]++;
  if (c['A'] == 1 && c['B'] == 1 && c['C'] == 1) {
    cout << "Yes";
    return 0;
  }
  for (long long i = (3); i < (s.size()); ++i) {
    c[s[i - 3]]--;
    c[s[i]]++;
    if (c['A'] == 1 && c['B'] == 1 && c['C'] == 1) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
  return 0;
}
