#include using namespace std; using ll=long long; ll modpow(ll n,ll k,ll mod){ ll pw=n; ll ret=1; while (k){ if (k%2==1){ ret*=pw; ret%=mod; } pw=pw*pw; pw%=mod; k/=2; } return ret; } int main(){ int n,b; cin>>n>>b; if (b==1) cout<<0<