#include using namespace std; using i64 = int64_t; int main() { i64 n; cin >> n; cout << (n % 6 ? "No" : "Yes") << endl; }