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