#include #include using namespace std; int main(){ string p; cin >> p; int N = p.size(); bool ok = true; if (p[0] != '1'){ ok = false; } if (!('2' <= p[N - 1] && p[N - 1] <= '4')){ ok = false; } for (int i = 1; i < N - 1; i++){ if (!('3' <= p[i] && p[i] <= '5')){ ok = false; } } if (ok){ cout << "Yes" << endl; } else { cout << "No" << endl; } }