#include #include #include #include using namespace std; using namespace atcoder; using namespace __gnu_pbds; using ll=long long; using ld=long double; using vll=vector; using vvll=vector; using pll=pair; // using mint=modint; // template // using ordered_map=tree,rb_tree_tag,tree_order_statistics_node_update>; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll N,K; cin>>N>>K; //2倍の操作回数をd回として(ここは全探索) for(ll d=0;;d++){ ll p=1LL<N)break; if((N-p)%3!=0)continue; ll T=(N-p)/3; ll q=T/p,r=T%p; if(d+q+__builtin_popcountll(r)<=K){ cout<<"YES"<