#include #include #include using namespace std; int main(){ string p; cin >> p; for(int i = 0; i < 100; i++){ p.insert(p.begin(), '0'); } int activing = 2; for(int i = int(p.size() - 1); i > 50; i--){ if((p[i] == '6' || p[i] == '7') && activing){ activing = 1; }else if('2' <= p[i] && p[i] <= '4' && activing == 2){ if(p[i - 1] == '0'){ cout << "No" << endl; return 0; }else{ p[i - 1]--; } }else if(p[i] == '0'){ activing = 0; }else{ cout << "No" << endl; return 0; } if(i == int(p.size() - 1) && activing == 1){ cout << "No" << endl; return 0; } } cout << "Yes" << endl; }