#include using namespace std; int main(){ int64_t N; cin >> N; int64_t ans = N; int count = 1; while(ans > 9){ ans /= 9; count *= 9; } if(count != 1) ans = N % count; if(ans % 2 == 0) cout << "YES" << endl; else cout << "NO" << endl; }