#include<bits/stdc++.h> using namespace std; unsigned long long n,k,tot,t; int main(){ cin>>n>>k; for(int i=n;i>=1;i--){ tot=pow(2,i)-1; t=tot/2; if(k>t){ cout<<1; k=tot-k; } else { cout<<0; } } return 0; }