import sys input = sys.stdin.readline N, K = map(int, input().split()) if N - 1 == K: print(N) else: print(N - 1)