#define ll long long #include using namespace std; int main(){ ll n,k; cin>>n>>k; if(k==0 | k>n){ cout<<0<