#include using namespace std; long long n, k; int main(){ cin >> n >> k; if(n > 1 && k != n - 1) cout << n - 1 << endl; else cout << n << endl; }