#include #include #include using namespace std; int main() { long long N; cin >> N; vectorA(N + 1, false); A.at(0) = true; A.at(1) = true; for (long long i = 2; i <= N; i++) { if (i % 2 == 0) { if (A.at(i / 2)) A.at(i) = true; else if (i > 3) { if (A.at(i - 3)) A.at(i) = true; } } else { if (i > 3) { if (A.at(i - 3)) A.at(i) = true; } } } if (A.at(N)) cout << "YES" << endl; else cout << "NO" << endl; }