#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int i;
  if (s.length() < 3) {
    cout << "NO" << endl;
    return 0;
  } else {
    for (i = 0; i < (s.length() - 2); i++) {
      if ((s[i] == 'A') && (s[i + 1] == 'B') && (s[i + 2] == 'C')) {
        cout << "YES" << endl;
        return 0;
      }
      if ((s[i] == 'A') && (s[i + 1] == 'C') && (s[i + 2] == 'B')) {
        cout << "YES" << endl;
        return 0;
      }
      if ((s[i] == 'B') && (s[i + 1] == 'A') && (s[i + 2] == 'C')) {
        cout << "YES" << endl;
        return 0;
      }
      if ((s[i] == 'B') && (s[i + 1] == 'C') && (s[i + 2] == 'A')) {
        cout << "YES" << endl;
        return 0;
      }
      if ((s[i] == 'C') && (s[i + 1] == 'A') && (s[i + 2] == 'B')) {
        cout << "YES" << endl;
        return 0;
      }
      if ((s[i] == 'C') && (s[i + 1] == 'B') && (s[i + 2] == 'A')) {
        cout << "YES" << endl;
        return 0;
      }
    }
    cout << "NO" << endl;
  }
  return 0;
}
