#include using namespace std; typedef long long ll; typedef pair P; int main() { cin.tie(0); ios::sync_with_stdio(false); ll N; cin >> N; if(N%6 == 0) cout << "Yes" << endl; else cout << "No" << endl; return 0; }