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(""))
flag = 0

for i in range(a+1):
    if (n-i)%500 == 0:
        print("Yes")
        flag = 1
        break
if flag == 0:
    print("No")

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

Solution (Python):
import math
 
a = []
for i in range(2):
    a.append(int(input()))
tmp = math.floor(a[0]/500)
tmp1 = a[0] - tmp*500
if a[1] >= tmp1:
    print('Yes')
else:
    print('No')

Solution (Python):
import math
 
a = []
for i in range(2):
    a.append(int(input()))
tmp = math.floor(a[0]/500)
tmp1 = a[0] - tmp*500
if a[1] >= tmp1:
    print('Yes')
else:
    print('No')

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

Solution (Python):
N = int(input())
A = int(input())
a = N % 500
if a == 0:
    print("Yes")
else:
    if a <= 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())
print('Yes' if (n%500)-a<=0 else 'No')

Solution (Python):
N = int(input())
modFive = N % 500
A = int(input())
if modFive <= 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())

quotient, remainder = divmod(N, 500)

if remainder <= 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())

n=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())
if N%500<=A:
    print('Yes')
else:
    print('No')

Solution (Python):
import numpy as np

N = input(); A= input()
A,N = int(A), int(N)

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

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

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

Solution (Python):
if __name__ == '__main__':
    n = int(input())
    a = int(input())

    t = n - (n // 500) * 500

    if ( t <= 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())

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

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

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

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

for i in range(0,N / 500):
	N = N - 500
if(N <= A):
	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())

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

Solution (Python):
N = int(input())
a = []
for i in range(1):
    a.append(int(input()))

if N % 500 ==0:
    print('Yes')
else:
    calc = N % 500
    if a[0] >= calc:
        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):
print("Yes" if int(input()) % 500 <= int(input()) else "No")

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

if a%500<=b:
    print "Yes"
else:
    print "No"

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

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

b=num%500
if b>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())

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

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

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

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
if a >= x:
    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())

if n-500*(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())
R = N % 500
if A >= R:
    print ('Yes')
else:
    print ('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())

p = N // 500
if N - 500*p <= A:
    print('Yes')
else:
    print('No')

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

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

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

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 int(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())
print('Yes' if int(N % 500) <= A else 'No')

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

mod = n % 500

if a >= mod:
    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
if n <= a:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
A = int(input())
mod = N % 500
if mod <= 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())

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

Solution (Python):
number = int(input())
one = int(input())
if number%500 <= one:
    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())

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

Solution (Python):
N = int(input())
A = int(input())
if N - N // 500 * 500 - A <= 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 == a) or(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
print("Yes" if N <= 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())
amari = N % 500
if amari <= A:
    print('Yes')
else:
    print('No')

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

if int(n)%500<=int(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())

c = N%500

if c > 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())
surplus = N % 500
if A >= surplus:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):

N = input()
A = input()

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

rest = N % 500

if rest<=A:
    print("Yes")

else:
    print("No")

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

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

print(ans)

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())
x = n // 500        
y = n - 500 * x    
if y <= a:
     print('Yes')
else:
    print('No')

Solution (Python):


n = int(raw_input())
a = int(raw_input())

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

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

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

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

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

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

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

Solution (Python):


n=int(raw_input())
a=int(raw_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())
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())
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('Yes')
else:
	print('No')

Solution (Python):
def main():
    N = int(input() )
    A = int(input() )
    
    surplus = N % 500

    if(surplus <= A):
        print("Yes")
    else:
        print("No")
    
if __name__=="__main__":
    main()

Solution (Python):


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

n = N%500

ans = ""

if n <= A:
    ans += "Yes"
    print(ans)
else:
    ans += "No"
    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):
a = int(input())
b = int(input())

c = a % 500

if b >= c:
    print("Yes")
else:
    print("No")

Solution (Python):


def t1(N, A):
    
    
    

    
    if not (isinstance(N, int)):
        return ("No")
    
    if not (1 <= N <= 10000):
        return ("No")

    
    if not (isinstance(A, int)):
        return ("No")

    
    if not (0 <= A <= 1000):
        return ("No")

    amari = N % 500

    if not amari:
        return ("Yes")

    if A >= amari:
        return ("Yes")
    else:
        return ("No")

loop_count = 0
input_list = []
while loop_count < 2:
    n = input()
    input_list.append(n)
    loop_count += 1
goukei = input_list[0]
ichien = input_list[1]
print (t1(goukei, ichien))

Solution (Python):

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

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

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

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

Solution (Python):

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

mod = N % 500

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

Solution (Python):
def main():
    N = int(input().strip()) 
    A = int(input().strip()) 

    zan = N
    if N > 500:
        zan = N % 500
    if zan > A:
        return "No"
    return "Yes"
if __name__ == '__main__':
    print(main())

Solution (Python):
def main():
    global A
    N = int(input())
    A = int(input())

    if N > 500:
        calc(N%500)
    
    elif N < 500:
        calc(N)

    else:
        print('Yes')

def calc(yen):
    if yen > A:
        print('No')
    else:
        print('Yes')




if __name__ == '__main__':
    main()

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())
for i in range(a+1):
    v=n-i
    if v%500==0:
        print("Yes")
        exit()
else:
    print("No")

Solution (Python):
N = int(input())
A = int(input())
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):
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):
if int(input()) % 500 <= int(input()): 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())

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

Solution (Python):
if __name__ == "__main__":
    n = int(raw_input())
    a = int(raw_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("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('No')
else:
 print('Yes')

Solution (Python):
N = int(input())
A = int(input())
N %= 500
print("Yes" if A >= N else "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())
for i in range(N//500+1):
    if N-500*i >=0 and N-500*i <= A:
        print('Yes')
        exit()
print('No')

Solution (Python):
n=int(raw_input())
a=int(raw_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 = input()
A = input()
print "No" if N % 500 > A else "Yes"

Solution (Python):
print (lambda x,y: "Yes" if x % 500 <= y else "No")(input(), input())

Solution (Python):
N=int(input())
A=int(input())
while N>=500 :
    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())
print("Yes" if N % 500 <= A else "No")

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

k = n % 500
if k <= 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):
a = int(input())
n = int(input())
if((a%500)<=n):
  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())

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

if __name__ == "__main__":
    hantei(N, A)

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):
import sys

with sys.stdin as f:
    s_input = f.read()

    in_list = s_input.splitlines()
    n = int(in_list[0])
    a = int(in_list[1])

    if n % 500 <= a:
        print("Yes")
    else:
        print("No")
        
sys.exit(0)

Solution (Python):



input_lines=input()
price=int(input_lines)

input_lines=input()
coins=int(input_lines)

frac=price%500

if frac>coins:
    print("No")
else:
    print("Yes")

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!=0
B=int(N%500)
if(B <= A):
    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())
n=(n%500)
if (n<=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):
def main():
    N = int(input())
    A = int(input())
    amari = N%500
    if(amari>A):
        print("No")
    else:
        print("Yes")

if __name__ == '__main__':
    main()

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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    a = I()
    if n%500 <= a:
        return 'Yes'

    return 'No'


print(main())

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

if A >= N:
    print("Yes")
else:
    n = N % 500
    if n == 0 or (n != 0 and A >= n):
        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())
if n % 500 <= a:
    print("Yes")
else:
    print("No")

Solution (Python):

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

Solution (Python):
import sys
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    input_raw = read_func().strip().split()
    [A] = [int(input_raw[0])]

    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())

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

Solution (Python):
N= int(input()[-3:])
A= int(input())

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

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

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

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

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

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

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

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

itien = N%500

if itien > A:
   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())

def solve():
    n5 = n // 500
    n1 = n - 500*n5
    if n1 > a:
        print("No")
    else:
        print("Yes")
solve()

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):
N=int(input())
A=int(input())
if(A!=0):
  if(N%500<=A):
    print("Yes")
  else:
    print("No")
elif(N%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())

temp = N%500
if temp<= 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())

rem = N % 500

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

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

print('Yes' if A >= N else 'No')

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

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

Solution (Python):
n=int(raw_input())
a=int(raw_input())
k=n/500
k*=500
if n-k<=a:
	print "Yes"
else:
	print "No"

Solution (Python):


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

if n%500==0:
    print("Yes")
elif n%500 < a:
    print("Yes")
elif n%500 == a:
    print("Yes")
elif n%500 > a:
    print("No")
else:
    pass

Solution (Python):

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

Tmp = N % 500

if A >= Tmp:
    print('Yes')
else:
    print('No')

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

Solution (Python):


def main(N, A):
    d = N % 500
    if d - A <= 0:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    N = int(input())
    A = int(input())
    main(N, A)

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

Solution (Python):
import sys      
import itertools
import functools
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())
if n<500:
    if a<n:
        print("No")
    else:
        print("Yes")
else:
    m=n%500
    if a<m:
        print("No")
    else:
        print("Yes")

Solution (Python):


yen = input()
ichi = input()


s = int(yen)%500

if s <= int(ichi):
   print("Yes")
else:
    print("No")

Solution (Python):

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

    r = N%500

    if r == 0:
        print ('Yes')
    elif a >= r:
        print ('Yes')
    else:
        print ('No')


if __name__ == "__main__":
    
    
    main()

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

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

Solution (Python):





if __name__ == '__main__':
    total_money = int(input())
    one_yen_count = int(input())

    balance = total_money % 500

    if one_yen_count - balance >= 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()) 
hantei = N % 500
if hantei <= 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):

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

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

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

Solution (Python):

total = int(input())
oneN = int(input())

num = oneN - (total % 500)

if num >= 0:
    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())
p = N % 500
if A >= p:
    print("Yes")
else:
    print("No")

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

a= N-500*(N//500)
if A >= a:
    print("Yes")
else:
    print("No")

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

tmp = N%500

if tmp>A:
    print('No')
else:
    print('Yes')

Solution (Python):
import sys,collections;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().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())

N = N%500

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

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

a = N%500;

if A - a >= 0:
	print ("Yes")

else:
	print("No")

Solution (Python):

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

if N <= A:
    print("Yes")
elif (N-A)%500 == 0:
    print("Yes")
elif (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(raw_input())
A = int(raw_input())
div = N % 500
if div <= A:
    print 'Yes'
else:
    print 'No'

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


if (N - ((N//500)*500) - A) <= 0:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):

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

num=N//500
NUM=N-500*num
if NUM <= A:
    print("Yes")
else:
    print("No")

Solution (Python):

en = int(input())
itien = int(input())

nokori = en % 500
if nokori <= itien:
    print("Yes")
else:
    print("No")

Solution (Python):


import numpy as np 

import copy 
import math

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):




def slove(n, a):
    if (n%500) <= a:
        return "Yes"
    else:
        return "No"


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

    print(slove(n, 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())

while n >= 500:
    n -= 500

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

Solution (Python):



import sys

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

if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin
n = int(stdin.readline())
a = int(stdin.readline())
ans = 'No'
for i in xrange(a+1):
 if (n-i)%500==0:
  ans = 'Yes'
  break
print ans

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

A_Infinite_Coins()

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

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

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

Solution (Python):
if __name__=='__main__':
    N = int(input())
    A = int(input())

    a = N//500 * 500

    if N-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())

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

Solution (Python):
N=input()
A=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())

remain = N % 500

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

Solution (Python):
f = lambda :[int(i) for i in input().split()]

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())
n = n%500
if(n<=a):
    print('Yes')
else:
    print('No')