E869120 has A 1-yen coins and infinitely many 500-yen coins.   Determine if he can pay exactly N yen using only these coins.

N,A =[int(input()) for i in range(2)]
for k in range(1,A+1):
    if N % k == 0:
        print("YES")
    else:
        print("NO")


N,A =[int(input()) for i in range(2)]
if 0 <= (N % 500) <= A:
    print("Yes")
else:
    print("No")
