#include #include using namespace std; #define ll long long int main() { ll n,k; cin>>n>>k; if(n%2==0){ ll t=min(n/2,k+1); cout<