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

N = int(input())
A = int(input())

left_N = N % 500
if N % 500 == 0:
  
  print("yes")
elif left_N < A:
  print("yes")
else:
  print("no")
#coding:UTF-8

N = int(input())
A = int(input())

left_N = N % 500
if N % 500 == 0:
  
  print("Yes")
elif left_N < A:
  print("Yes")
else:
  print("No")
  