#include #include using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 10000000000000001 int main(){ int N,K; cin>>N>>K; vector s = {"01","0011","00010111"}; if(K<=3){ if(s[K-1].size()>=N){ cout<