#include <bits/stdc++.h>
using namespace std;
int main() {
  int A = 0;
  int B = 0;
  int C = 0;
  char s[110];
  cin >> s;
  int i = 0;
  int count = 0;
  int ans = 0;
  for (int i = 0; i < strlen(s); i++) {
    if (s[i] != '.') {
      if (count == 0)
        count++;
      else if (count == 1) {
        if (s[i] != s[i - 1]) count++;
      } else if (count == 2) {
        if (s[i] != s[i - 1] && s[i] != s[i - 2])
          count++;
        else if (s[i] == s[i - 1])
          count = 1;
      }
      if (count == 3) {
        ans = 1;
        break;
      }
    } else
      count = 0;
  }
  if (ans)
    cout << "Yes";
  else
    cout << "No";
  cout << endl;
  return 0;
}
