#include <bits/stdc++.h>
using namespace std;

int n;

int main() {
  cin >> n;
  cout << ((n % 6 == 0) ? "Yes" : "No") << endl;
  return 0;
}