#include <bits/stdc++.h>
using namespace std;
using lint     = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    lint n;
    cin >> n;
    if (n % 6 == 0)
        cout << "Yes"
             << "\n";
    else
        cout << "No"
             << "\n";
    return 0;
}