#line 1 "main.cpp" #include #include // #include "library/templates/template.cpp" using namespace atcoder; using namespace std; using ll = long long int; using ull = unsigned long long int; using ld = long double; using pii = pair; using pll = pair; long long solve(long long N, long long K) { if (N == 1) { return 1; } if (K != N - 1) { return N - 1; } else { return N; } } int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); long long N, K; std::cin >> N >> K; auto ans = solve(N, K); std::cout << ans << '\n'; return 0; }