#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void solve() { std::string s; std::cin >> s; std::vector a(s.size()); for (int i = 0; i < 6; i++) { a[i] = s[i] - '0'; } auto f = [&]() { if (a.back() == 2 or a.back() == 3 or a.back() == 7 or a.back() == 8) return false; if (a.back() & 1) { if (a[4] & 1) return false; } if (a.back() & 1 and a[4] & 1) return false; if (a.back() == 6 and a[4] % 2 == 0) return false; if (a.back() == 5 and a[4] != 2) return false; int cnt = 0; for (int i = 5; i >= 0; i--) { if (a[i] == 0) cnt++; else break; } if (cnt & 1) return false; if (a.back() == 1 or a.back() == 4 or a.back() == 9) { if (a[4] & 1) return false; } if (a[4] & 1) { if (a.back() != 6) return false; } if (a.back() != 6) { if (a[4] % 2 != 0) return false; } return true; }; if (f()) { std::cout << "YES\n"; } else { std::cout << "NO\n"; } } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); std::cout << std::boolalpha; int t = 1; // std::cin >> t; while (t--) solve(); // solve(); return 0; }