#include using namespace std; typedef long long ll; typedef pair P; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) template inline bool chmin(T &a, T b) {if (a > b){a = b;return true;}return false;} template inline bool chmax(T &a, T b) {if (a < b){a = b;return true;}return false;} int main(){ ll n; cin >> n; string ans = "Yes"; if(n%6) ans = "No"; cout << ans << endl; }