#include using namespace std; using pii = pair; using ll = long long; #define rep(i, j, n) for(int i = j; i < (int)(n); i++) const ll MOD = 1000000007; const ll INF = 1LL << 60; int main() { int N; cin >> N; if (N % 6 == 0) cout << "Yes" << endl; else cout << "No" << endl; }