#include using namespace std; int main() { int n; cin >> n; assert(1 <= n && n <= (1 << 16)); if (n % 6) { cout << "No" << endl; } else { cout << "Yes" << endl; } }