#include #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) using namespace std; typedef long long ll; int main(void){ 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; }