#include #include #include #include #include #include #include #include #include #if __has_include() # include # include # include # include # include #endif #include #include #include #include #include #include #include #define CLIBCXX_DEBUG #define ll long long #define hmap unordered_map #define hset unordered_set using namespace std; #if __has_include() using namespace atcoder; using mint10 = static_modint<10>; using mint24 = static_modint<24>; using mint = modint998244353; #endif ll powll(ll a, ll b) { //制約 ans∊ll a, b∊double range return (ll)pow(a, b / 2) * (ll)pow(a, b - b / 2); } ll sum(ll a, ll b) { return a + b; } ll e() { return 0; } //return true if an argument is prime or one bool isPrime(double num, set& primes, set& comps){ if(num==1){ return false; } if(primes.find(num)!=primes.end()){ return true; } if(comps.find(num)!=comps.end()){ return false; } double sq = sqrtf64(num); for(int32_t i = 2; i <= sq; ++i){ if((ll)num%i==0){ comps.insert(num); return false; } } primes.insert(num); return true; } int main() { ll n,k; cin >> n>>k; if(n==1){ cout << 1; } else if(k!=n-1){ cout << (n-1); }else { cout << n; } }