N,K = map(int,input().split()) if N <= K or N % (K+1) == 0: print(1000) else: print(0)