Problem:
 Score: 100 points    Problem Statement  E869120 has A  1 -yen coins and infinitely many 500 -yen coins. Determine if he can pay exactly N yen using only these coins.      Constraints   N is an integer between 1 and 10000 (inclusive).  A is an integer between 0 and 1000 (inclusive).         Input  Input is given from Standard Input in the following format:  N  A       Output  If E869120 can pay exactly N yen using only his 1 -yen and 500 -yen coins, print Yes ; otherwise, print No .        Sample Input 1 2018
218      Sample Output 1 Yes  We can pay 2018 yen with four 500 -yen coins and 18  1 -yen coins, so the answer is Yes .       Sample Input 2 2763
0      Sample Output 2 No  When we have no 1 -yen coins, we can only pay a multiple of 500 yen using only 500 -yen coins. Since 2763 is not a multiple of 500 , we cannot pay this amount.       Sample Input 3 37
514      Sample Output 3 Yes

Solution (Python):

N =int(input())
A =int(input())
if N % 500 <=A:
    print('Yes')
else:
    print('No')

Solution (Python):
n=int(input())
a=int(input())
x=n%500
if a>=x:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())
print('Yes' if N%500 <= A else 'No')

Solution (Python):
n=int(input())
a=int(input())
n %= 500
if(n <= a):
    print("Yes")
else:
    print("No")

Solution (Python):

N = int(input())
A = int(input())
if (N%500)-A <= 0:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())

print("Yes" if N%500 <= A else "No")

Solution (Python):
n = int(input())
a = int(input())

ans = n % 500

if ans <= a:
    print('Yes')
else:
    print('No')

Solution (Python):
n, a = [int(input()) for _ in range(2)]
print('Yes' if n%500 <= a else 'No')

Solution (Python):
N = int(input())
A = int(input())
if A >= N % 500:
    print('Yes')
else:
    print('No')

Solution (Python):
print("Yes" if int(input())%500<=int(input()) else "No")

Solution (Python):
n = int(input())
a = int(input())

if n % 500 <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = int(input())

flg = False
for i in range(a+1):
    if (n-i) % 500 == 0:
        flg = True
        break

if flg:
    print("Yes")
else:
    print("No")

Solution (Python):
N,A=eval('int(input()),'*2)
while True:
    if N >= 500:
        N-=500
    else:
        break
print('Yes' if A>=N else 'No')

Solution (Python):
n = int(input())
a = int(input())
n = n % 500
if (n <= a):
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = int(input())

if n % 500 <= a:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())

if N % 500 <= A:
	print('Yes')
else:
	print('No')

Solution (Python):
import sys
input=sys.stdin.readline

N = int(input())%500
A = int(input())

if N <= A:
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
a = int(input())
if (n % 500) <= a:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
A = int(input())
amari = N % 500
if amari <= A:
        print("Yes")
else:
        print("No")

Solution (Python):
n=int(input())
a=int(input())
print('Yes' if n%500<=a else 'No');

Solution (Python):
n = int(input())
a = int(input())
if n % 500 <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
a=int(input())
if n%500<=a:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())
if (N % 500 <= A):
  print('Yes')
else:
  print('No')

Solution (Python):
N,A = map(int, [input() for i in range(2)])

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

Solution (Python):


n = int(input())
a = int(input())

if n % 500 <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())

N = N % 500

if N <= A:
  print("Yes")
else:
  print("No")

Solution (Python):



import sys
import math


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

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

Solution (Python):
N = int(input())
A = int(input())
print("Yes" if A >= N%500 else "No")

Solution (Python):
n=int(input())
a=int(input())
print('Yes' if n%500<=a else 'No');

Solution (Python):
n=int(input())
a=int(input())
if n%500<=a:
  print('Yes')
else:
  print('No')

Solution (Python):
N=int(input())
A=int(input())
if N%500>A :
  print("No")
else :
  print("Yes")

Solution (Python):
n=int(input())
a=int(input())
if n%500<=a:
    print('Yes')
else:
    print('No')

Solution (Python):
print('Yes' if int(input())%500 <= int(input()) else 'No')

Solution (Python):
n = int(input())
a = int(input())
if n%500 <= a:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A:
    print("Yes")
else:
    print("No")

Solution (Python):
N=int(input())
A=int(input())
print('Yes' if N%500<=A else 'No')

Solution (Python):
N = int(input())
A = int(input())

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

Solution (Python):
N = int(input())
A = int(input())
         
if N%500 <=A:
  print('Yes')
         
else:
  print('No')

Solution (Python):
N = int(input())
A = int(input())
rem = N%500
if rem<=A:
    print('Yes')
else:
    print('No')

Solution (Python):
n=int(input())
a=int(input())
if n%500<=a:
    print("Yes")
else:
    print("No")

Solution (Python):

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

if N % 500 <= A:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
A = int(input())

p = N % 500

if p == 0:
    print('Yes')
else:
    if p <= A:
        print('Yes')
    else:
        print('No')

Solution (Python):
N=int(input())
A=int(input())
N%=500
if N<=A:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
A = int(input())
N -= 500*(int(N/500))
if(A>=N):
  print('Yes')
else:
  print('No')

Solution (Python):
n = int(input())
a = int(input())
if n % 500 <= a:
    print('Yes')
else:
    print('No')

Solution (Python):
def solve(string):
    n, a = map(int, string.split())
    return "Yes" if n % 500 <= a else "No"


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

Solution (Python):
N = int(input())
A = int(input())

if N % 500 > A:
    print('No')
else:
    print('Yes')

Solution (Python):
N = int(input())
A = int(input())

c = N % 500

if c <= A:
  print('Yes')
else:
  print('No')

Solution (Python):
N, A = int(input()), int(input())
print('Yes' if N % 500 <= A else 'No')

Solution (Python):
X = int(input())
A = int(input())
if X % 500 <= A:
	print('Yes')
else:
	print('No')

Solution (Python):
print('No'if eval(input()+'%500>'+input())else'Yes')

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())

if A < N % 500:
    print('No')
else:
    print('Yes')

Solution (Python):
N=int(input())
A=int(input())

a=N%500
if A>=a:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())
 
if N%500 <= A:
  print("Yes")
else:
  print("No")

Solution (Python):
n=int(input())
a=int(input())
print('Yes' if n%500<=a else "No")

Solution (Python):
shiharaigaku = int(input())
itienkouka = int(input())
if shiharaigaku % 500 > itienkouka:
    print("No")
else:
        print("Yes")

Solution (Python):
N=int(input())
A=int(input())

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

Solution (Python):
def main():
    print('YNeos'[int(input()) % 500 > int(input())::2])


main()

Solution (Python):
n = int(input())
a = int(input())

if a >= n % 500:
    print('Yes')
else:
    print("No")

Solution (Python):
n,a=[int(input()) for _ in range(2)]
print("Yes" if n%500 <= a else "No")

Solution (Python):
N = int(input())
A = int(input())

r = N % 500
if r > A:
    print("No")
else:
    print("Yes")

Solution (Python):
if int(input())%500>int(input()):print("No")
else:print("Yes")

Solution (Python):
N = int(input())
A = int(input())
hituyo_coin = N%500
if(hituyo_coin > A):
    print("No")
else:
    print("Yes")

Solution (Python):
N = int(input())
A = int(input())
print('Yes') if A>=N%500 else print('No')

Solution (Python):
n = int(input())
a = int(input())

coin = n%500
if coin <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
n,a=[int(input()) for i in range(2)]
b=n%500
if a>=b:
    print("Yes")
else:
    print("No")

Solution (Python):

n = int(input())
a = int(input())
if(n%500<=a):
    print("Yes")
else:
    print("No")

Solution (Python):
from sys import exit

N = int(input())
A = int(input())
if (N%500<=A): print("Yes")
else: print("No")

exit()

Solution (Python):
N = int(input())
A = int(input())

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

Solution (Python):
n = int(input())
a = int(input())

if n % 500 <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = int(input())
for i in range(a + 1):
    if (n - i) % 500 == 0:
        print('Yes')
        exit()
print('No')

Solution (Python):
print('YNeos'[int(input())%500>int(input())::2])

Solution (Python):
n=int(input())
a=int(input())
print('Yes' if n%500<=a else 'No')

Solution (Python):

a = int(input())
b = int(input())

print( 'Yes' if a%500 <= b else 'No')

Solution (Python):
N=int(input())
A=int(input())


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

Solution (Python):
N = int(input())
A = int(input())

if int(N % 500) <= A:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = int(input())
b = n%500
if a>=b:
  print("Yes")
else:
  print("No")

Solution (Python):
def infinite_coins(N: int, A: int) -> bool:
    return N % 500 <= A


if __name__ == "__main__":
    N = int(input())
    A = int(input())
    yes = infinite_coins(N, A)
    print('Yes' if yes else 'No')

Solution (Python):
N = int(input())
A = int(input())

B = N % 500
if B <= A:
  print("Yes")
else:
  print("No")

Solution (Python):
n = int(input())
a = int(input())

if (n % 500) <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())
N %= 500
if N <= A:
  print("Yes")
else:
  print("No")

Solution (Python):
N=int(input())
A=int(input())
print("Yes" if N%500<=A else "No")

Solution (Python):
n = int(input())
a = int(input())
ans, flag = 0, False
for i in range(21):
  for j in range(a + 1):
    if 500 * i + j == n:
      flag = True
if flag:
  print("Yes")
else:
  print("No")

Solution (Python):
n = int(input())
a = int(input())

if n % 500 <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
n,a=[int(input()) for i in range(2)]
print("Yes" if n%500<=a else "No")

Solution (Python):
N = int(input())
A = int(input())
if N%500<=A:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())
if N%500 <= A:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())

ans = "No"
if(N%500 <= A):
  ans = "Yes"
print(ans)

Solution (Python):
N = int(input())
A = int(input())
if (N % 500) <= A:
  print("Yes")
else:
  print("No")

Solution (Python):
N=int(input())
A=int(input())
if N%500<=A:
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
a = int(input())
n%=500

if n<=a:
  print('Yes')
else:
  print('No')

Solution (Python):
n = int(input())
a = int(input())

print("Yes" if n%500 <= a else "No")

Solution (Python):
n=int(input())
a=int(input())
n%=500
if n<=a:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A:
    print('Yes')
else:
    print('No')

Solution (Python):


import itertools
import collections
import bisect

def main():
    N = int(input())
    A = int(input())
    print("Yes" if N % 500 <= A else "No")

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = int(input())

res = N%500
if A >= res:
	print("Yes")
else:
	print("No")

Solution (Python):
N = int(input())
A = int(input())

if(N%500 <= A):
  print('Yes')
else:
  print('No')

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    A = int(input())
    
    a = N % 500
    if a <= A:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Solution (Python):
import sys
N = int(input())
A = int(input())
for n_500 in range(21):
  for n_1 in range(A + 1):
    if n_500 * 500 + n_1 * 1 == N:
      print('Yes')
      sys.exit()
print('No')

Solution (Python):
N = int(input())
A = int(input())
reminder = N % 500
print("Yes" if reminder <= A else "No")

Solution (Python):
def main():
    N = int(input())
    A = int(input())
    if N % 500 <= A:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Solution (Python):
a = int(input())
b = int(input())
print("Yes" if a % 500 <= b else "No")

Solution (Python):
print('Yes' if int(input())%500 <= int(input()) else 'No')

Solution (Python):
print("Yes" if int(input()) % 500 <= int(input()) else "No")

Solution (Python):

N = int(input())
A = int(input())
print(['No', 'Yes'][N % 500 <= A])

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A:
    print("Yes")
else:
    print("No")

Solution (Python):

n = int(input())
a = int(input())

if n % 500 <= a:
    print('Yes')
else:
    print('No')

Solution (Python):
N=int(input())
A=int(input())
if N%500<=A:
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
A = int(input())

if N % 500 > A:
  print("No")
else:
  print("Yes")

Solution (Python):
n = int(input())
a = int(input())
if a >= n % 500:
    print('Yes')
else:
    print('No')

Solution (Python):
n=int(input())
a=int(input())
print("Yes" if n%500<=a else "No")

Solution (Python):
n = int(input())
a = int(input())

if((n % 500) > a):
    print("No")
else:
    print("Yes")

Solution (Python):

n = int(input())
a = int(input())
print("Yes") if (n % 500 <= a) else print("No")

Solution (Python):
n = int(input())
a = int(input())
if n % 500 <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = int(input())
print("Yes") if n % 500 <= a else print("No")

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A:
    print("Yes")
else:
    print("No")

Solution (Python):
n,a=int(input()),int(input())
print('Yes' if n%500<=a else 'No')

Solution (Python):
n = int(input())
a = int(input())

if (n % 500) <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
a=int(input())
b=int(input())
if (a%500)<=b:
  print("Yes")
else:
  print("No")

Solution (Python):
n= int(input())
a= int(input())
if n%500<=a:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = int(input())
if n % 500 <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
from sys import stdin
n=int(stdin.readline().rstrip())
a=int(stdin.readline().rstrip())
if a>=n%500:
  print('Yes')
else:
  print('No')

Solution (Python):
if int(input())%500<=int(input()):
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())

ans = N % 500 <= A

print("Yes" if ans else "No")
print()

Solution (Python):
N = int(input())
A = int(input())
x = N % 500
if x <= A:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())
print("Yes" if N%500<=A else "No")

Solution (Python):
N = int(input())
A = int(input())
if A >= N % 500 :
    print('Yes')
else:
    print('No')

Solution (Python):
a = int(input())
b = int(input())
if a%500 <= b:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())
 
if(N % 500 <= A):
  print("Yes")
else:
  print("No")

Solution (Python):

"""
Created on Sun Feb 24 20:12:13 2019

@author: yuta
"""

def judge(n,a):
    rest500 = int(n / 500)
    rest1 = n - (500 * rest500)
    if rest1 <= a:
        print("Yes")
    else:
        print("No")

x = input()
y = input()
judge(int(x),int(y))

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())
if (N % 500) <= A:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = int(input())

if (n%500<=a):
    print('Yes')
else:
    print('No')

Solution (Python):
a=int(input());b=int(input())
print("YNeos"[a%500>b::2])

Solution (Python):
a = int(input())
b = int(input())
c = a % 500
if c <= b:
  print("Yes")
else:
  print("No")

Solution (Python):
N=int(input())
A=int(input())
if N%500>A:
  print('No')
else:
  print('Yes')

Solution (Python):
N=int(input())
A=int(input())
if N%500==0:
  print('Yes')
else:
  if A>=N%500:
    print('Yes')
  else:
    print('No')

Solution (Python):
N = int(input())
A = int(input())
if N%500 <= A:
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
A = int(input())
if N%500<=A:
    print("Yes")
else:
    print("No")

Solution (Python):
N=int(input())
A=int(input())



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

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A:
    print("Yes")
else:
    print("No")

Solution (Python):
N, A = int(input()), int(input())

while N >= 500:
    N = N - 500

if A >= N:
    print("Yes")
else:
    print("No")

Solution (Python):
import bisect
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
A = I()

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

Solution (Python):
n = int(input())
a = int(input())

if n%500 <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
a=int(input())
b=int(input())
print('Yes' if a%500<=b else 'No')

Solution (Python):
n = int(input()) % 500
a = int(input())
if a >= n:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
A = int(input())
if(N%500 <= A):
  print("Yes")
else:
  print("No")

Solution (Python):
N=int(input())
A=int(input())

if N%500 <= A:
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
a = int(input())

d = n%500

if d <= a:
    print('Yes')
else:
    print('No')

Solution (Python):
n=int(input())
a=int(input())
if n%500<=a:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
a=int(input())
print('Yes' if n%500<=a else 'No')

Solution (Python):
n = int(input())
a = int(input())

if n%500 <= a:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
A = int(input())

num = N % 500

if A >= num:
    print("Yes")
else:
    print("No")

Solution (Python):
int_n = int(input())
int_a = int(input())

if (int_n % 500) <= int_a:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())
if A >= N % 500:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
a=int(input())
n=n%500
if n>a:
    print("No")
else:
    print("Yes")

Solution (Python):
n = int(input())
a = int(input())
if n%500 <= a:
  print("Yes")
else:
  print("No")

Solution (Python):
n = int(input())
a = int(input())
if n%500 <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())
k = N // 500 
print("Yes") if N<=A else print("Yes") if (N - A)/500 <= k else print("No")

Solution (Python):
N = int(input())
A = int(input())
k = N // 500 
if N <= A:
    print("Yes")
elif (N - A)/500 <= k:
    print("Yes")
else:
    print("No")

Solution (Python):
a=int(input())
b=int(input())
if(b-a%500>=0):
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())

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

Solution (Python):
n = int(input())
a = int(input())
if (n%500) <= a:
    ans = "Yes"
else:
    ans = "No"
print(ans)

Solution (Python):
a = int(input())
b = int(input())
while a>=500:
  a-=500
if b>=a:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())

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

Solution (Python):
N = int(input())
A = int(input())

amari = N%500

if amari <= A:
    print("Yes")
else:
    print("No")

Solution (Python):

arr = []
for i in range(2):
  arr.append(int(input()))

N = arr[0]
A = arr[1]

left = N % 500
if left > A:
  print('No')
else:
  print('Yes')

Solution (Python):
n=int(input())
a=int(input())
for i in range(a+1):
  if (n-i)%500==0:
    print("Yes")
    exit()
print("No")

Solution (Python):
a,n =[int(input()) for i in range(2)]
if a%500<=n:
    print('Yes')
else:
    print('No')

Solution (Python):
a = int(input())
b = int(input())
if a%500 <= b:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = int(input())


if n-n//500*500 <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
print("YNeos"[int(input())%500>int(input())::2])

Solution (Python):
N = int(input())
A = int(input())
print("Yes" if N % 500 <= A else "No")

Solution (Python):
money = int(input())
coins = int(input())
mod = money % 500
if coins >= mod:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input()) % 500
X = int(input())
if N <= X:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())

amari = N%500
if amari <= A:
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
A = int(input())

N = N % 500

if N <= A:
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
A = int(input())

if N%500<=A:
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
A = int(input())

mod_500 = divmod(N, 500)
mod_500 = mod_500[1]

j = A - mod_500

if j >= 0:
    print('Yes')
else :
    print('No')

Solution (Python):

N = int(input())
A = int(input())
if N % 500 <= A:
    print('Yes')
else:
    print("No")

Solution (Python):
""" AtCoder """

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

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

Solution (Python):
n = int(input())
a = int(input())

res = (n % 500) <= a

if res:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
a=int(input())
 
if n%500 <=a:
  print("Yes")
else:
  print("No")

Solution (Python):
n=int(input())
a=int(input())
print('Yes' if (n%500)<=a else 'No')

Solution (Python):


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

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

Solution (Python):
a = int(input())
b = int(input())
if a%500 <= b:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())

if N%500 <= A:
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
a = int(input())
r = n % 500
if r <= a:
    print('Yes')
else:
    print('No')

Solution (Python):
N=int(input())
A=int(input())
print("Yes" if N%500<=A else "No")

Solution (Python):

n = int(input())
a = int(input())

x = n // 500
y = n - (500 * x)
if a >= y:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = int(input())
b = n//500

if a >= n-b*500:
    print('Yes')
else:
    print('No')

Solution (Python):
N=int(input())
A=int(input())
print('Yes' if N%500<=A else 'No')

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A: print('Yes')
else: print('No')

Solution (Python):
N = int(input())
A = int(input())
if A<(N%500) :
    print('No')
else:
    print('Yes')

Solution (Python):
N = int(input())
A = int(input())

B = N % 500

if A >= B:
    print("Yes")
else:
    print("No")

Solution (Python):
N=int(input())
A=int(input())
if N%500<=A:
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
A = int(input())

if (N%500) > A:
	 print("No")
else:
	print("Yes")

Solution (Python):
n = int(input())
a = int(input())
if n%500 <= a:
  print("Yes")
else:
  print("No")

Solution (Python):
n = int(input())
a = int(input())

n = n - (n//500)*500
if n <=a:
  print("Yes")
else: print("No")

Solution (Python):


n = int(input())
a = int(input())

print("Yes" if n%500 <= a else "No")

Solution (Python):
N = int(input())
A = int(input())
n = N%500
if n <= A:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())
if (N%500)>A:
  print("No")
else:
  print("Yes")

Solution (Python):
n = int(input()) % 500
a = int(input())
if a >= n:
  print("Yes")
else:
  print("No")

Solution (Python):
n = int(input())
a = int(input())
m = n % 500
if m <= a:
    print('Yes')
else:
    print('No')

Solution (Python):
def main():
  x = int(input())
  a = int(input())
  if (x % 500) > a:
    print('No')
    return
  print('Yes')
  return
    
if __name__ == '__main__':
  main()

Solution (Python):
import sys

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

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

Solution (Python):
N = int(input())
A = int(input())
if N%500==0:
	print('Yes')
elif N%500<=A:
	print('Yes')
else:
	print('No')

Solution (Python):
N = int(input())
A = int(input())
sub = N % 500
if(sub <= A):
  print('Yes')
else:
  print('No')

Solution (Python):
print(['No','Yes'][int(input())%500<=int(input())])

Solution (Python):
print("Yes" if int(input())%500<=int(input()) else "No")

Solution (Python):
N = int(input())
a = int(input())

z = N % 500
if z <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
if int(input()) >= N % 500:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = int(input())
if (n % 500) <= a:
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
A = int(input())
if (N % 500) <= A:
  print("Yes")
else:
  print("No")

Solution (Python):
n = int(input())
a = int(input())
n = n % 500
if n <= a:
  print('Yes')
else:
  print('No')

Solution (Python):
import sys

lines = sys.stdin.readlines()

for n, line in enumerate(lines):
  if n == 0:
    cache = int(line.strip())
  else:
    ones = int(line.strip())

if (cache % 500) - ones <= 0:
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
A = int(input())

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

Solution (Python):
print("YNeos"[(int(input())%500>int(input()))::2])

Solution (Python):


def main():
    N = int(input())
    A = int(input())

    print('Yes' if N % 500 <= A else 'No')


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    n = int(input())
    a = int(input())
    if n % 500 <= a:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
A=int(input())
if N%500<=A:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())
print('Yes' if N % 500 <= A else 'No')

Solution (Python):
n = int(input())
a = int(input())

if n % 500 <= a:
    print('Yes')
else:
    print('No')

Solution (Python):
def abc088_a():
    n = int(input())
    a = int(input())
    if n % 500 <= a:
        print("Yes")
    else:
        print("No")


abc088_a()

Solution (Python):
n=int(input())
a=int(input())
N=n%500
if N<=a:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())
kanauso = N%500
if kanauso <= A:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())

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

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A:
    print('Yes')
else:
    print('No')

Solution (Python):
if __name__ == '__main__':
    total = int(input())
    num = int(input())

    if total % 500 <= num:
        print("Yes")
    else:
        print("No")

Solution (Python):
n = int(input())
a = int(input())
if n % 500 <= a:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())
N = N % 500
if N > A:
    print("No")
else:
    print("Yes")

Solution (Python):


N = input()
A = input()
G = N%500
if A>=G:
  print 'Yes'
else:
  print 'No'

Solution (Python):
n = int(input())
a = int(input())

if n%500 <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
a = int(input())
b = int(input())

print('Yes') if a%500 <= b else print('No')

Solution (Python):
n,a = [int(input()) for _ in range(2)]
if n % 500 <= a:
    print('Yes')
else:
    print('No')

Solution (Python):

N = int(input())
A = int(input())
if N % 500 > A:
  print("No")
else:
  print("Yes")

Solution (Python):
n=int(input())
a=int(input())

if n%500>a:
    print("No")
else:
    print("Yes")

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A:
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
a = int(input())
if n%500 <= a:
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
a = int(input())

if n%500 <= a:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())

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

Solution (Python):
N = int(input())
A = int(input())
if (N % 500) <= A:
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
a = int(input())

print("Yes" if (n % 500) <= a else "No")

Solution (Python):
n=int(input())
a=int(input())
print('Yes' if n%500 <=a else 'No')

Solution (Python):
n = int(input())
a = int(input())

if n%500<=a:
  print("Yes")
else:
  print("No")

Solution (Python):

print('Yes' if int(input())%500 <= int(input()) else 'No')

Solution (Python):
n = int(input())
a = int(input())

num = n // 500
if n - 500 * num <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())
if N%500 > A:
  print("No")
else:
  print("Yes")

Solution (Python):
a = int(input())
b = int(input())
if a % 500 <= b:
  print("Yes")
else:
  print("No")

Solution (Python):
n = int(input())
a = int(input())

rest = n - 500 * (n // 500)
if rest <= a:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
a=int(input())
n1=n%500
if n1<=a:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())

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

Solution (Python):
n = int(input())
A = int(input())

if n%500 <= A:
    print('Yes')
else:
    print('No')

Solution (Python):
allMoney=int(input())
oneCoins=int(input())
nokori = allMoney % 500
otsuri = oneCoins - nokori
if otsuri >= 0:
	print('Yes')
else:
	print('No')

Solution (Python):


if __name__ == "__main__":
    n = int(input())
    a = int(input())

    if n % 500 <= a:
        print("Yes")
    else:
        print("No")

Solution (Python):
N = int(input())
A = int(input())
B = N//500
if N - B*500<=A:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
A = int(input())
if N % 500 <= A:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
A = int(input())

rest = N % 500

if( rest <= A):
  print('Yes')
  
else:
  print('No')

Solution (Python):
n = int(input())
a = int(input())

print('Yes' if n % 500 - a <= 0 else 'No')

Solution (Python):

N = int(input())
A = int(input())
if N % 500 > A: print("No")
else: print("Yes")

Solution (Python):
N = int(input())
A = int(input())

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

Solution (Python):
N=int(input())
A=int(input())

B=N%500

if(A>=B):
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
a = int(input())

n1 = n % 500

print("Yes" if a >= n1 else "No")

Solution (Python):
print'YNeos'[input()%500>input()::2]

Solution (Python):
N = int(input())
A = int(input())

while(N >= 0):
    N -= 500

N += 500

flag = False
for i in range(A+1):
    if i == N: flag = True

if flag: print('Yes')
else: print('No')