#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  string a[6] = {"ABC", "ACB", "BCA", "BAC", "CBA", "CAB"};
  for (int i = 0; i < 6; i++) {
    if (strstr(s.c_str(), a[i].c_str())) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
