#include using namespace std; #define int long long #define endl "\n" using db = long double; using pi = pair; using pd = pair; #define mp make_pair #define f first #define s second #define tcT template using V = vector; tcT, size_t SZ > using AR = array; using ll = long long; using vi = V; using vb = V; using vd = V; using vs = V; using vpi = V; using vpd = V; #define sz(x) (int)((x).size()) #define bg(x) begin(x) #define all(x) bg(x), end(x) #define rall(x) x.rbegin(), x.rend() #define sor(x) sort(all(x)) #define rsz resize #define ins insert #define pb push_back #define eb emplace_back #define ft front() #define bk back() #define lb lower_bound #define ub upper_bound tcT > int lwb(V &a, const T &b) { return (int)(lb(all(a), b) - bg(a)); } tcT > int upb(V &a, const T &b) { return (int)(ub(all(a), b) - bg(a)); } #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define F0R(i, a) FOR(i, 0, a) #define ROF(i, a, b) for (int i = (b)-1; i >= (a); --i) #define R0F(i, a) ROF(i, 0, a) #define rep(a) F0R(_, a) #define each(a, x) for (auto &a : x) const db PI = acos((db)-1); const int dx[4]{1, 0, -1, 0}, dy[4]{0, 1, 0, -1}; mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count()); mt19937_64 rng64((uint64_t)chrono::steady_clock::now().time_since_epoch().count()); template using pqg = priority_queue, greater>; // bitwise ops constexpr int pct(int x) { return __builtin_popcount(x); } // # of bits set constexpr int bits(int x) { return x == 0 ? 0 : 63 - __builtin_clz(x); } // floor(log2(x)) constexpr int p2(int x) { return 1 << x; } constexpr int isp2(int x) { return x && (x & -x) == x; } constexpr int mask(int x) { return p2(x) - 1; } // ceil, floor int cdiv(int a, int b) { return a / b + ((a ^ b) > 0 && a % b); } int fdiv(int a, int b) { return a / b - ((a ^ b) < 0 && a % b); } tcT > bool ckmin(T &a, const T &b) { return b < a ? a = b, 1 : 0; } // set a = min(a,b) tcT > bool ckmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; } // set a = max(a,b) tcTU > T fstTrue(T lo, T hi, U f) { ++hi; assert(lo <= hi); // assuming f is increasing while (lo < hi) { // find first index such that f is true T mid = lo + (hi - lo) / 2; f(mid) ? hi = mid : lo = mid + 1; } return lo; } tcTU > T lstTrue(T lo, T hi, U f) { --lo; assert(lo <= hi); // assuming f is decreasing while (lo < hi) { // find first index such that f is true T mid = lo + (hi - lo + 1) / 2; f(mid) ? lo = mid : hi = mid - 1; } return lo; } tcT > void remDup(vector &v) { // sort and remove duplicates sort(all(v)); v.erase(unique(all(v)), end(v)); } tcTU > void safeErase(T &t, const U &u) { auto it = t.find(u); assert(it != end(t)); t.erase(it); } tcT > V prefSum(const V &a) { V ret = a; FOR(i, 1, sz(ret)) ret[i] += ret[i - 1]; return ret; } // sorted[i] = v[idx[i]] tcT > vi sortedIdx(const V &v) { vi ret(sz(v)); iota(all(ret), 0); sort(all(ret), [&](int i, int j) { return v[i] < v[j]; }); return ret; } tcT > T SUM(const V &v) { T ret = 0; each(x, v) ret += x; return ret; } tcT > T MAX(const V &v) { return *max_element(all(v)); } tcT > T MIN(const V &v) { return *min_element(all(v)); } tcT > int MAXidx(const V &v) { return max_element(all(v)) - bg(v); } tcT > int MINidx(const V &v) { return min_element(all(v)) - bg(v); } tcT > int findIdx(const V &v, const T &x) { auto it = find(all(v), x); return it == end(v) ? -1 : it - bg(v); } inline namespace IO { #define SFINAE(x, ...) \ template struct x : std::false_type {}; \ template struct x> : std::true_type {} SFINAE(DefaultI, decltype(std::cin >> std::declval())); SFINAE(DefaultO, decltype(std::cout << std::declval())); SFINAE(IsTuple, typename std::tuple_size::type); SFINAE(Iterable, decltype(std::begin(std::declval()))); template struct Reader { template void Impl(T &t) { if constexpr (DefaultI::value) is >> t; else if constexpr (Iterable::value) { for (auto &x : t) Impl(x); } else if constexpr (IsTuple::value) { std::apply([this](auto &...args) { (Impl(args), ...); }, t); } else static_assert(IsTuple::value, "No matching type for read"); } template void read(Ts &...ts) { ((Impl(ts)), ...); } }; template void re(Ts &...ts) { Reader{}.read(ts...); } #define def(t, args...) \ t args; \ re(args); template struct Writer { string comma() const { return debug ? "," : ""; } template constexpr char Space(const T &) const { return print_nd && (Iterable::value or IsTuple::value) ? '\n' : ' '; } template void Impl(T const &t) const { if constexpr (DefaultO::value) os << t; else if constexpr (Iterable::value) { if (debug) os << '{'; int i = 0; for (auto &&x : t) ((i++) ? (os << comma() << Space(x), Impl(x)) : Impl(x)); if (debug) os << '}'; } else if constexpr (IsTuple::value) { if (debug) os << '('; std::apply( [this](auto const &...args) { int i = 0; (((i++) ? (os << comma() << " ", Impl(args)) : Impl(args)), ...); }, t); if (debug) os << ')'; } else static_assert(IsTuple::value, "No matching type for print"); } template void ImplWrapper(T const &t) const { Impl(t); } template void print(Ts const &...ts) const { ((Impl(ts)), ...); } template void print_with_sep(const std::string &sep, F const &f, Ts const &...ts) const { ImplWrapper(f), ((os << sep, ImplWrapper(ts)), ...), os << '\n'; } void print_with_sep(const std::string &) const { os << '\n'; } }; template void pr(Ts const &...ts) { Writer{}.print(ts...); } template void ps(Ts const &...ts) { Writer{}.print_with_sep(" ", ts...); } } // namespace IO inline namespace Debug { template void err(Args... args) { Writer{}.print_with_sep(" | ", args...); } void err_prefix(string func, int line, string args) { cerr << func << ":" << line << " - " << "[" << args << "] = "; } #ifdef LOCAL #define dbg(args...) err_prefix(__FUNCTION__, __LINE__, #args), err(args) #else #define dbg(...) #endif void setIO() { cin.tie(0)->sync_with_stdio(0); cout << fixed << setprecision(12); } } // namespace FileIO namespace std { template class y_combinator_result { Fun fun_; public: template explicit y_combinator_result(T &&fun) : fun_(std::forward(fun)) {} template decltype(auto) operator()(Args &&...args) { return fun_(std::ref(*this), std::forward(args)...); } }; template decltype(auto) fun(Fun &&fun) { return y_combinator_result>(std::forward(fun)); } // usage : fun([&](auto dfs, int u, int p) -> void ... } // namespace std /* start */ void solve(int tc) { def(int, n); if (n % 8 == 0 || n % 8 == 7) ps("Yes"); else ps("No"); } signed main() { setIO(); int TC = 1; // re(TC); FOR(i, 1, TC + 1) solve(i); }