#include using namespace std; typedef long long ll; typedef pair l_l; typedef pair i_i; template inline bool chmax(T &a, T b) { if(a < b) { a = b; return true; } return false; } template inline bool chmin(T &a, T b) { if(a > b) { a = b; return true; } return false; } const long double EPS = 1e-10; const long long INF = 1e18; const long double PI = acos(-1.0L); //const ll mod = 1000000007; int main() { //cout.precision(10); cin.tie(0); ios::sync_with_stdio(false); ll N; cin >> N; string ans = "Yes"; if(N % 6) ans = "No"; cout << ans << endl; return 0; }