n,k=map(int,input().split()) if k==1: exit(print(n)) M=100003 m=max(n+1,M) t=[0]*m for i in range(1,m): ni=i while ni