#include <bits/stdc++.h>
long long inf = 1LL << 62;
long long mod = 1000000007;
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  for (int i = 1; i < s.length() - 1; i++) {
    if (s[i - 1] == 'A' && s[i] == 'B' && s[i + 1] == 'C') {
      cout << "YES";
      return 0;
    }
    if (s[i - 1] == 'A' && s[i] == 'C' && s[i + 1] == 'B') {
      cout << "YES";
      return 0;
    }
    if (s[i - 1] == 'B' && s[i] == 'A' && s[i + 1] == 'C') {
      cout << "YES";
      return 0;
    }
    if (s[i - 1] == 'B' && s[i] == 'C' && s[i + 1] == 'A') {
      cout << "YES";
      return 0;
    }
    if (s[i - 1] == 'C' && s[i] == 'A' && s[i + 1] == 'B') {
      cout << "YES";
      return 0;
    }
    if (s[i - 1] == 'C' && s[i] == 'B' && s[i + 1] == 'A') {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
