let () =
  let (n, a) = Scanf.scanf "%d %d" (fun x y -> (x, y)) in
  let remainder = n mod 500 in
  let ans = if remainder < a
            then "Yes"
            else "No" in
  Printf.printf "%s\n" ans
