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):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N = k()
A = k()

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

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

Solution (Python):


N = input()
A = input()

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

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
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

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

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

Solution (Python):
a = int(input()) % 500
b = int(input())
print("Yes" if a <= b else "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 = int(input())

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

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

sys.exit() if not (1 <= N <= 10000) else ''
sys.exit() if not (0 <= A <= 1000) else ''

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

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

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

Solution (Python):










import sys

def input(): return sys.stdin.readline()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]

def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))

sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)


N = iIn()
A = iIn()

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

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

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

if n%500==0 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):
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

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

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

while N >= 0:
    N -= 500

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

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,a=map(int,open(0))
print('YNeos'[n%500>a::2])

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-(N//500)*500<=A:
	print("Yes")
else:
	print("No")

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

a=int(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())

pay500 = N

while pay500 >= 500:
    pay500 = pay500 - 500

if pay500 <= 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
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

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

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

q = N % 500

if q <= 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()) for i in range(2))
 
B = N % 500

if B <= 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,a = int(input()), int(input())
while n >= 500:
    n -= 500
print("Yes" if n <=a else "No")

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

Solution (Python):
import sys
a1 = []
for l in sys.stdin:
    a1.append(int(l))
n , a = tuple(a1)
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())

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

Solution (Python):
def main():
    N = int(input())
    A = int(input())
    if N <= A:
        print('Yes')
        return
    times = N // 500
    if times*500 + A >= N:
        print('Yes')
    else:
        print('No')
main()

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

Solution (Python):
n,a=map(int,open(0));print("YNeos"[n%500>a::2])

Solution (Python):
import sys

input = sys.stdin.readline


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

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

    print(ans)


if __name__ == "__main__":
    main()

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

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

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

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

res = n % 500

if a >= res:
  print('Yes')
else:
  print('No')

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

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

Solution (Python):
N_en = int(input())
A_mai = int(input())

mod = N_en - 500 * (N_en // 500)

if (A_mai >= mod):
    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())
while N >= 500:
  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):
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())
rest = n % 500
if rest > 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,a=map(int,open(0));print('NYoe s'[n%500<=a::2])

Solution (Python):
def actual(n, a):
    if n % 500 <= a:
        return 'Yes'

    return 'No'

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

print(actual(n, a))

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())
buf =N - ((N//500)*500)
print("Yes" if A >= buf else "No")

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

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

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

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

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

n = n % 500

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

Solution (Python):
n = int(input())
a = int(input())
ans = n - (n // 500) * 500
if ans > a:
    print('No')
else:
    print('Yes')

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

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 a < n%500:
  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,A = map(int,open(0).read().split())

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

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

Solution (Python):
n = int(input())
a = int(input())
n %= 500
if n - a > 0:
    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):
a = int(input())
b = int(input())

if a % 500 == 0:
    print("Yes")
elif 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):
a = int(input())
b = int(input())

if a % 500 == 0:
    print("Yes")
elif 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):
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())

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

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

c = 0


for i in range(21):
    for j in range(A+1):
        if N == 500 * i + j:
            c = c+1
if c ==0:
    print('No')
else:
    print('Yes')

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

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

Solution (Python):
lst = []
for _ in range(2):
    lst.append(int(input()))
if (lst[0] % 500) <= lst[1]:
    print("Yes")
else:
    print("No")

Solution (Python):

def main():
    n = int(input())
    a = int(input())
    n = n % 500
    if n <= 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):
amount = int(input())
n_1yen = int(input())

fraction = amount % 500

if fraction <= n_1yen:
	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):
n = int(input())
a = int(input())

i = n % 500

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

r = N%500

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

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

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

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 '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 - (N//500)*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):
N = int(input())
A = int(input())

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

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

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

amari=n%500

if amari<=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






























def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    a = ii()
    print('Yes') if n % 500 <= a 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()) % 500
if int(input()) >= 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):
def li():
    return list(map(int, input().split()))


def mi():
    return map(int, input().split())


def ii():
    return int(input())


N = ii()
A = ii()

modN500 = N % 500

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

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

q, r = divmod(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())
b = n % 500
c = a - b
if c >= 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())
print('Yes' if n%500<=a else '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())

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

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

B = N % 500

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

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

s=N%500

if s<=A:
    print("Yes")
    exit()

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

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):
import sys
 
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
 
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())

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

Solution (Python):
x = [int(input()) for i in range(2)]
if x[0] % 500 <= x[1]:
    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):
import collections


def inputStrOnebyOne():
    s = list(input())
    return s


def inputOnebyOne_Int():
    a = list(int(x) for x in input().split())
    return a

def main():
    a = int(input())
    b = int(input())
    if(a%500<=b):
        print("Yes")
    else:
        print("No")
        
if __name__=='__main__':
    main()

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

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

resolve()

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

  return

if __name__ == "__main__":
  resolve()

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

for i in range(A+1):
    if (N-i)%500==0:
        print('Yes')
        break
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 -= (n//500) * 500
print('Yes' if a >= n 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):
import sys
input = sys.stdin.readline

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

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

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

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

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

Solution (Python):
N, A = map(int, (input() for _ in range(2)))
print('Yes' if N % 500 <= A else 'No')

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

N2= N  %  500;

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

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

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

Solution (Python):
n = int(input())%500
if n<=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):
pay = int(input())
one_coin = int(input())
amari = pay%500
if amari <= one_coin:
  print('Yes')
else:
  print('No')

Solution (Python):

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

Solution (Python):


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


def main() -> None:
    """Entry point
    """
    
    """
    500円で割ったあまりと1円の枚数を比較
    """
    result = str()
    if (N % 500) <= A:
        result = "Yes"
    else:
        result = "No"

    
    print(result)


if __name__ == "__main__":
    main()

Solution (Python):


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


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


print(result)

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 = int(input())
a = int(input())

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

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

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

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

Solution (Python):
n1 = int(input())
n2 = int(input())

a = n1%500

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

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

c = a % 500

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

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

Solution (Python):
import sys
import math
import bisect

def solve(n, m):
    for i in range(m + 1):
        if i > n:
            break
        if (n - i) % 500 == 0:
            return True
    return False

def main():
    n = int(input())
    m = int(input())
    if solve(n, m):
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

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

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

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

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

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

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 > 1000:
    N = N%1000
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())

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

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

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

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

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

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

if __name__ == '__main__':

    ABC_88_A()

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

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

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