#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a,b,c;
    cin >> a;

for(int i = 0; i  <3; ++i){
    if((a+3)%10 == 0){
    cout << "Yes";
    return 0;
    }
    a/=10;
}
    cout <<"No"<<endl;
}
