#include using namespace std; int main() { int N,K; cin>>N>>K; if(N!=1)K=(K==N-1?N:N-1); cout<