n, k = map(int,input().split()) if n - 1 == k: print(n) else: print(n - 1)