#if !defined(MYLOCAL)//提出時用テンプレート #pragma GCC optimize("Ofast") #if defined(NDEBUG) #undef NDEBUG #endif #include "bits/stdc++.h" #if !defined(_MSC_VER) && __has_include() #include using namespace atcoder; #endif #define _HAS_STD_BYTE 0//testlibのbyteがstd::byteと競合するため、std::byteを無効化 #define FOR_LINUX #include "testlib.h" using namespace std; using ll=long long; using dd=double; using vll=vector< ll>; using vdd=vector< dd>; using vvll=vector< vll>; using vvdd=vector; using vvvll=vector< vvll>; using vvvdd=vector; using vvvvll=vector; using pll=pair; using tll=tuple; using qll=tuple; using vpll=vector< pll>; using vtll=vector< tll>; using vqll=vector< qll>; using vvpll=vector; using vvtll=vector; using vvqll=vector; using namespace chrono; constexpr ll INF = 1001001001001001001; struct Fast{ Fast(){ cin.tie(0); ios::sync_with_stdio(false); cout<::max_digits10); } } fast; #define REPS(i, S, E) for (ll i = (S); i <= (E); i++) #define REP(i, N) REPS(i, 0, (N)-1) #define DEPS(i, S, E) for (ll i = (E); i >= (S); i--) #define DEP(i, N) DEPS(i, 0, (N)-1) #define EXPAND( x ) x//VS用おまじない #define overload3(_1,_2,_3,name,...) name #define overload4(_1,_2,_3,_4,name,...) name #define overload5(_1,_2,_3,_4,_5,name,...) name #define rep3(i, S, E) for (ll i = (S); i <= (E); i++) #define rep4(i, S, E, t) for (ll i = (S); i <= (E); i+=(t)) #define rep(...) EXPAND(overload4(__VA_ARGS__,rep4,rep3,_,_)(__VA_ARGS__)) #define dep3(i, E, S) for (ll i = (E); i >= (S); i--) #define dep4(i, E, S, t) for (ll i = (E); i >= (S); i-=(t)) #define dep(...) EXPAND(overload4(__VA_ARGS__, dep4, dep3,_,_)(__VA_ARGS__)) #define each2(e,v) for (auto && e:v) #define each3(a,b,v) for (auto &&[a,b]:v) #define each4(a,b,c,v) for (auto &&[a,b,c]:v) #define each5(a,b,c,d,v) for (auto &&[a,b,c,d]:v) #define each(...) EXPAND(overload5(__VA_ARGS__,each5,each4,each3,each2,_)(__VA_ARGS__)) #define ALL1(v) (v).begin(), (v).end() #define ALL2(v,E) (v).begin(), (v).begin()+((E)+1) #define ALL3(v,S,E) (v).begin()+(S), (v).begin()+((E)+1) #define ALL(...) EXPAND(overload3(__VA_ARGS__, ALL3, ALL2, ALL1)(__VA_ARGS__)) #define all ALL #define RALL1(v) (v).rbegin(), (v).rend() #define RALL2(v,E) (v).rbegin(), (v).rbegin()+((E)+1) #define RALL3(v,S,E) (v).rbegin()+(S), (v).rbegin()+((E)+1) #define RALL(...) EXPAND(overload3(__VA_ARGS__, RALL3, RALL2, RALL1)(__VA_ARGS__)) #define rall RALL 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; } template inline T MaxE(vector&v,ll S,ll E){ T m=v[S]; rep(i,S,E)chmax(m,v[i]); return m; } template inline T MinE(vector&v,ll S,ll E){ T m=v[S]; rep(i,S,E)chmin(m,v[i]); return m; } template inline T MaxE(vector &v) { return MaxE(v,0,(ll)v.size()-1); } template inline T MinE(vector &v) { return MinE(v,0,(ll)v.size()-1); } template inline auto maxe(T &&v,ll S,ll E){ return *max_element(ALL(v,S,E)); } template inline auto maxe(T &&v){ return *max_element(ALL(v)); } template inline auto mine(T &&v,ll S,ll E){ return *min_element(ALL(v,S,E)); } template inline auto mine(T &&v){ return *min_element(ALL(v)); } template inline T Sum(vector &v,ll S,ll E){ T s=T(); rep(i,S,E)s+=v[i]; return s; } template inline T Sum(vector &v) { return Sum(v,0,v.size()-1); } template::type::value_type> inline U sum(T &&v,ll S,ll E) {return accumulate(all(v,S,E),U());} template inline auto sum(T &&v) {return sum(v,0,v.end()-v.begin()-1);} template inline ll sz(T &&v){ return (ll)v.size(); } inline ll CEIL(ll a,ll b){ return (a<0) ? -(-a/b) : (a+b-1)/b; } //負もOK inline ll FLOOR(ll a,ll b){ return -CEIL(-a,b); } //負もOK //pair用テンプレート template inline pair& operator+=(pair &a,const pair &b){ a.first+=b.first; a.second+=b.second; return a; } template inline pair& operator-=(pair &a,const pair &b){ a.first-=b.first; a.second-=b.second; return a; } template inline pair& operator*=(pair &a,const pair &b){ a.first*=b.first; a.second*=b.second; return a; } template inline pair& operator/=(pair &a,const pair &b){ a.first/=b.first; a.second/=b.second; return a; } template inline pair& operator%=(pair &a,const pair &b){ a.first%=b.first; a.second%=b.second; return a; } template inline pair& operator+=(pair &a,R b){ a.first+=b; a.second+=b; return a; } template inline pair& operator-=(pair &a,R b){ a.first-=b; a.second-=b; return a; } template inline pair& operator*=(pair &a,R b){ a.first*=b; a.second*=b; return a; } template inline pair& operator/=(pair &a,R b){ a.first/=b; a.second/=b; return a; } template inline pair& operator%=(pair &a,R b){ a.first%=b; a.second%=b; return a; } template inline pair operator+(const pair &a,R b){ pair c=a; return c+=b; } template inline pair operator-(const pair &a,R b){ pair c=a; return c-=b; } template inline pair operator*(const pair &a,R b){ pair c=a; return c*=b; } template inline pair operator/(const pair &a,R b){ pair c=a; return c/=b; } template inline pair operator%(const pair &a,R b){ pair c=a; return c%=b; } template inline pair operator-(R b,const pair &a){ pair c=-a; return c+=b; } template inline pair operator-(const pair &a,const pair &b){ pair c=a; return c-=b; } template inline pair operator-(const pair &a){ pair c=a; return c*=(-1); } template inline ostream &operator<<(ostream &os,const pair &a){ return os << a.first << ' ' << a.second; } //tuple用テンプレート 出力用のみ template inline ostream &operator<<(ostream &os,const tuple &a){ return os << get<0>(a) << ' ' << get<1>(a) << ' ' << get<2>(a); } template inline ostream &operator<<(ostream &os,const tuple &a){ return os << get<0>(a) << ' ' << get<1>(a) << ' ' << get<2>(a) << ' ' << get<3>(a); } //vector用テンプレート template inline ostream &operator<<(ostream &os,const vector &a){ for (ll i=0; i<(ll)a.size(); i++) os<<(i>0?" ":"")< inline array& operator+=(array &a,const array &b){ for (ll i=0; i<(ll)S; i++) a[i]+=b[i]; return a; } template inline array& operator-=(array &a,const array &b){ for (ll i=0; i<(ll)S; i++) a[i]-=b[i]; return a; } template inline array& operator*=(array &a,const array &b){ for (ll i=0; i<(ll)S; i++) a[i]*=b[i]; return a; } template inline array& operator/=(array &a,const array &b){ for (ll i=0; i<(ll)S; i++) a[i]/=b[i]; return a; } template inline array& operator%=(array &a,const array &b){ for (ll i=0; i<(ll)S; i++) a[i]%=b[i]; return a; } template inline array& operator+=(array &a,R b){ for (T &e: a) e+=b; return a; } template inline array& operator-=(array &a,R b){ for (T &e: a) e-=b; return a; } template inline array& operator*=(array &a,R b){ for (T &e: a) e*=b; return a; } template inline array& operator/=(array &a,R b){ for (T &e: a) e/=b; return a; } template inline array& operator%=(array &a,R b){ for (T &e: a) e%=b; return a; } template inline array operator+(const array &a,R b){ array c=a; return c+=b; } template inline array operator-(const array &a,R b){ array c=a; return c-=b; } template inline array operator*(const array &a,R b){ array c=a; return c*=b; } template inline array operator/(const array &a,R b){ array c=a; return c/=b; } template inline array operator%(const array &a,R b){ array c=a; return c%=b; } template inline array operator-(R b,const array &a){ array c=-a; return c+=b; } template inline array operator-(const array &a,const array &b){ array c=a; return c-=b; } template inline array operator-(const array &a){ array c=a; return c*=(-1); } template inline ostream &operator<<(ostream &os,const array &a){ for (ll i=0; i<(ll)S; i++) os<<(i>0?" ":"")<) #include using namespace atcoder; #endif struct{ system_clock::time_point st = system_clock::now(); ll operator()()const{return duration_cast(system_clock::now()-st).count()/1000;} } timeget; ////////////////////////////////////////// template struct mll_{ using Int = long long; using ll = long long; ll val_=0; /*---- utility ----*/ mll_ &norm(){ return normR().normS(); }//正規化 mll_ &normR(){ val_%=MOD; return *this; }//剰余正規化のみ mll_ &normS(){ if (val_<0) val_+=MOD; return *this; }//正負正規化のみ mll_ &normP(){ if (val_>=MOD) val_-=MOD; return *this; }//加算時正規化 mll_ &invsg(){ val_=-val_; return normS(); }//正負反転 ll modinv(int a){//a^-1 mod MOD int ypre=0,y=1,apre=MOD; while (a>1){ int t=apre/a; apre-=a*t,swap(a,apre); ypre-=y*t,swap(y,ypre); } return y<0 ? y+MOD: y; } /*---- I/F ----*/ mll_(){} mll_(ll v): val_(v){ norm(); } mll_(ll v,bool b): val_(v){} //正規化無のコンストラクタ Int val()const{ return (Int)val_; } bool isnone() const { return val_==-1; } //true:値なし mll_ &none() { val_=-1; return *this; } //値なしにする mll_ &inv(){ val_=modinv((int)val_); return *this; } mll_ &operator+=(mll_ b){ val_+=b.val_; return normP(); } mll_ &operator-=(mll_ b){ val_-=b.val_; return normS(); } mll_ &operator*=(mll_ b){ val_*=b.val_; return normR(); } mll_ &operator/=(mll_ b){ return *this*=b.inv(); } mll_ &operator+=(ll b){ return *this+=mll_(b); } mll_ &operator-=(ll b){ return *this-=mll_(b); } mll_ &operator*=(ll b){ return *this*=mll_(b); } mll_ &operator/=(ll b){ return *this/=mll_(b); } mll_ operator-()const{ return mll_(*this).invsg(); } mll_ operator+(mll_ b)const{ return mll_(*this)+=b; } mll_ operator-(mll_ b)const{ return mll_(*this)-=b; } mll_ operator*(mll_ b)const{ return mll_(*this)*=b; } mll_ operator/(mll_ b)const{ return mll_(*this)/=b; } mll_ operator+(ll b)const{ return mll_(*this)+=b; } mll_ operator-(ll b)const{ return mll_(*this)-=b; } mll_ operator*(ll b)const{ return mll_(*this)*=b; } mll_ operator/(ll b)const{ return mll_(*this)/=b; } friend mll_ operator+(ll a,mll_ b){ return b+a; } friend mll_ operator-(ll a,mll_ b){ return -b+a; } friend mll_ operator*(ll a,mll_ b){ return b*a; } friend mll_ operator/(ll a,mll_ b){ return mll_(a)/b; } bool operator==(mll_ b)const{ return val_==b.val_; } bool operator!=(mll_ b)const{ return val_!=b.val_; } bool operator==(ll b)const{ return *this==mll_(b); } bool operator!=(ll b)const{ return *this!=mll_(b); } friend bool operator==(ll a,mll_ b){ return mll_(a)==b; } friend bool operator!=(ll a,mll_ b){ return mll_(a)!=b; } friend ostream &operator<<(ostream &os,mll_ a){ return os << a.val_; } friend istream &operator>>(istream &is,mll_ &a){ return is >> a.val_; } mll_ pow(ll k)const{ mll_ ret(1,false),a(*this); for (; k>0; k>>=1,a*=a) if (k&1)ret*=a; return ret; } static constexpr int mod() { return MOD; } //enum{ modll=MOD }; }; #if 0 #define MODLL (1000000007LL) #else #define MODLL (998244353LL) #endif using mll = mll_; //using mll = fraction; using vmll = std::vector; using vvmll = std::vector; using vvvmll = std::vector; using vvvvmll = std::vector; template struct Vector: vector{ using Int = long long; using vT=vector; using cvT=const vector; using cT=const T; using vT::vT; //親クラスのコンストラクタの隠蔽を回避 using vT::begin,vT::end,vT::insert,vT::erase; auto it(Int i){ return begin()+i; } auto it(Int i)const{ return begin()+i; } Vector(cvT& b):vT(b){} Vector(vT&& b):vT(move(b)){} Vector(Int n,T s,T d){ iota(n,s,d); } template Vector &operator+=(S x){ for (T &e: *this) e+=x; return *this; } template Vector &operator-=(S x){ for (T &e: *this) e-=x; return *this; } template Vector &operator*=(S x){ for (T &e: *this) e*=x; return *this; } template Vector &operator/=(S x){ for (T &e: *this) e/=x; return *this; } template Vector &operator%=(S x){ for (T &e: *this) e%=x; return *this; } template Vector operator+(S x)const{ return Vector(*this)+=x; } template Vector operator-(S x)const{ return Vector(*this)-=x; } template Vector operator*(S x)const{ return Vector(*this)*=x; } template Vector operator/(S x)const{ return Vector(*this)/=x; } template Vector operator%(S x)const{ return Vector(*this)%=x; } Vector operator-()const{ return Vector(*this)*=-1; } template friend Vector operator-(S x,const Vector &a){ return -a+=x; } Int size()const{ return (Int)vT::size(); } Vector &push_back(cT& x){ vT::push_back(x); return *this; } Vector &pop_back(){ vT::pop_back(); return *this; } Vector &push_front(cT& x){ insert(begin(),x); return *this; } Vector &pop_front(){ erase(0); return *this; } Vector &insert(Int i,cT& x){ insert(it(i),x); return *this; } Vector &insert(Int i,cvT& b){ insert(it(i),b.begin(),b.end()); return *this; } Vector &erase(Int i){ erase(it(i)); return *this; } Vector &erase(Int l,Int r){ erase(it(l),it(r+1)); return *this; } Vector &concat(cvT &b){ insert(end(),b.begin(),b.end()); return *this; } Vector &concat(cvT &b,Int n){ for (int i=0;i Vector &sort(Pr pr){ std::sort(begin(),end(),pr); return *this; } Vector &uniq(){ erase(unique(begin(),end()),end()); return *this; } Vector &sortq(){ return sort().uniq(); } Vector &fill(Int l,Int r,cT& x){ std::fill(it(l),it(r+1),x); return *this; } template Vector &iota(Int n,T s=0,S d=1){ vT::resize(n); if (n==0) return *this; (*this)[0]=s; for (int i=1;i Int countif(Pr pr)const{ return Int(count_if(begin(),end(),pr)); } template Int countif(Int l,Int r,Pr pr)const{ return Int(count_if(it(l),it(r+1),pr)); } Int find(cT& x)const{ return Int(std::find(begin(),end(),x)-begin()); } Int find(Int l,Int r,cT& x)const{ return Int(std::find(it(l),it(r+1),x)-begin()); } template Int findif(Pr pr)const{ return Int(find_if(begin(),end(),pr)-begin()); } template Int findif(Int l,Int r,Pr pr)const{ return Int(find_if(it(l),it(r+1),pr)-begin()); } Vector findall(cT& x)const{ return findall(0,size()-1,x); } Vector findall(Int l,Int r,cT& x)const{ return findallif(l,r,[&](cT& y){return y==x;}); } template Vector findallif(Pr pr)const{ return findallif(0,size()-1,pr); } template Vector findallif(Int l,Int r,Pr pr)const{ Vector ret; for (Int i=l;i<=r;++i) if (pr((*this)[i])) ret.push_back(i); return ret; } Int flooridx(cT& x)const{ return Int(upper_bound(begin(),end(),x)-begin()-1); } Int ceilidx(cT& x)const{ return Int(lower_bound(begin(),end(),x)-begin()); } Int leftnmof(cT& x)const{ return flooridx(x)+1; } Int rightnmof(cT& x)const{ return size()-ceilidx(x); } bool contains(cT& x)const{ Int i=flooridx(x); return i>=0 && (*this)[i]==x; } template Int flooridx(cT& x,Pr pr)const{ return Int(upper_bound(begin(),end(),x,pr)-begin()-1); } template Int ceilidx(cT& x,Pr pr)const{ return Int(lower_bound(begin(),end(),x,pr)-begin()); } template Int leftnmof(cT& x,Pr pr)const{ return flooridx(x,pr)+1; } template Int rightnmof(cT& x,Pr pr)const{ return size()-ceilidx(x,pr); } template bool contains(cT& x,Pr pr)const{ Int i=flooridx(x,pr); return i>=0 && (*this)[i]==x; } }; /* vll a={9,8,7},b={1,2,3}; vpll p={{5,3},{7,8},{0,2},}; - -------- 操作系 -------- a+=x a-=x a*=x a/=x a%=x a+x a-x a*x a/x a%x -a x-a //∀i a[i]にxを演算 a.push_front(x); a.push_back(x); a.pop_front(); a.pop_back(); a.insert(i,x); //a[i]にx挿入 a.insert(i,b); //a[i]にvll b挿入 a.erase(i); //a[i]削除 a.erase(l,r); //区間[l,r]削除 a.concat(b); //aにbを結合 a.concat(b,n); //aにbをn回結合 a.repeat(n); //aをn回繰り返す a.reverse(); //反転 a.sort(); //ソート a.rsort(); //逆順ソート p.sort([&](pll x,pll y){return x.second0; }; //検索条件 ll m=a.count(x); //xの個数 ll m=a.count(l,r,x); //xの個数in[l,r] ll m=a.countif(pr); //条件満たす個数 ll m=a.countif(l,r,pr); //条件満たす個数in[l,r] ll i=a.find(x); //xの最左位置i ない時N(配列長) ll i=a.find(l,r,x); //xの最左位置i in[l,r] ない時r+1 ll i=a.findif(pr); //条件満たす最左位置i ない時N(配列長) ll i=a.findif(l,r,pr); //条件満たす最左位置i in[l,r] ない時r+1 vll is=a.findall(x); //xの位置i列挙 vll is=a.findall(l,r,x); //xの位置i列挙in[l,r] vll is=a.findallif(pr); //条件満たす位置i列挙 vll is=a.findallif(l,r,pr); //条件満たす位置i列挙in[l,r] - -------- 昇順sort済み配列用 -------- ll i=a.flooridx(x); //x以下の最近傍位置i ない時-1 ll i=a.ceilidx(x); //x以上の最近傍位置i ない時N(配列長) ll m=a.leftnmof(x); //x以下の個数 ll m=a.rightnmof(x); //x以上の個数 bool b=a.contains(x); //xを含む - -------- 比較関数prでsort済みの配列用 -------- auto pr=[&](auto &x,auto &y){ return x>y; }; //降順ソート時 ll i=a.flooridx(x,pr); //x以左の最近傍位置i ない時-1 ll i=a.ceilidx(x,pr); //x以右の最近傍位置i ない時N(配列長) ll m=a.leftnmof(x,pr); //x以左の個数 ll m=a.rightnmof(x,pr); //x以右の個数 bool b=a.contains(x,pr); //xを含む a.concat(b,n).pop_back().rsort().uniq(); //連続適用できる */ namespace SolvingSpace{ template using vector = Vector; using vll=vector< ll>; using vmll=vector< mll>; using vdd=vector< dd>; using vvll=vector< vll>; using vvmll=vector< vmll>; using vvdd=vector< vdd>; using vvvll=vector< vvll>; using vvvmll=vector< vvmll>; using vvvdd=vector; using vvvvll=vector; using vvvvmll=vector; using vpll=vector< pll>; using vtll=vector< tll>; using vqll=vector< qll>; using vvpll=vector< vpll>; using vvtll=vector< vtll>; using vvqll=vector; void cin2solve() { ll n; cin >> n; if (n%8==0 or n%8==7){ cout << "Yes" << '\n'; } else{ cout << "No" << '\n'; } return; } };//SolvingSpace ////////////////////////////////////////// int main(){ #if 1 //SolvingSpace::labo(); SolvingSpace::cin2solve(); //SolvingSpace::generate2(); #else ll t; cin >> t; rep(i,0,t-1){ SolvingSpace::cin2solve(); //SolvingSpace::generand(); } #endif cerr << timeget() <<"ms"<< '\n'; return 0; }