#include #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef int64_t Int; using namespace std; int main(){ int N; cin >> N; if(N % 6 == 0){ cout << "Yes" << endl; } else { cout << "No" << endl; } }