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



Sample input:
2018
218


Sample output:
Yes

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = int(input())
if N % 500 <= A:
    print('Yes')
else:
    print("No")

Submission status: Accepted

Solution code:
""" AtCoder """

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

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

Submission status: Accepted

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

res = (n % 500) <= a

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#encoding:utf-8

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

B = N % 500

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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


abc088_a()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = int(input())
if N % 500 > A:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# Infinite Coins
print('Yes' if int(input())%500 <= int(input()) else 'No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

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

Submission status: Accepted

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

Submission status: Accepted

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

rest = N % 500

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
A = int(input())
if N % 500 > A: print("No")
else: print("Yes")

Submission status: Accepted

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

B=N%500

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

Submission status: Accepted

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

n1 = n % 500

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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

Submission status: Accepted

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

t = n % 500 - a

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

c=a%500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

amari = N % 500

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

Submission status: Accepted

Solution code:
# coding: utf-8

N_yen = int(input())
A_1mai = int(input())

answer = 'Yes' if N_yen % 500 <= A_1mai else 'No'
print(answer)

Submission status: Accepted

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

X = 0
while X <= N:
	if N - X <= A:
		print("Yes")
		exit()
	X += 500

print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

N %= 500

ans = 'Yes' if A >= N else 'No'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
x = n%500
if x <= a:
    print('Yes')
elif x > a:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#入力
N = int(input())
A = int(input())
#Nを500で割った余りを求める
#それがA以下ならばよい
n = N % 500
if n <= A:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n  = int( input())
a  = int( input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
if a >= 500:
  c=a//500
  l=a-c*500
  if l <= b:
    print("Yes")
  else:
    print("No")
else:
  if a <= b:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
#coding: utf-8
N, A = int(input()), int(input())
print(["No","Yes"][N%500<=A])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Z = N - (N//500 * 500)

if Z > A:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

V = N % 500

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

Submission status: Accepted

Solution code:
n = int(input())
if n%500 < int(input())+1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

flag = 1

while(flag == 1):
    if n >= 500:
        n -= 500

    else:
        flag = 0

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

else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
n = (n % 500)
print(["No", "Yes"][n <= a])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
m = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
r = n-int(n/500)*500
if r <= a:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
A = int(stdin.readline().rstrip())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
B=[int(input()) for _ in range(2)]
print(["Yes","No"][B[0]%500>B[1]])

Submission status: Accepted

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

diff = (N % 500)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
A=int(input())
R=N%500
ans='Yes'
if R>A:
    ans='No'
print(ans)

Submission status: Accepted

Solution code:
N = int(raw_input())
A = int(raw_input())

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(["Yes", "No"][N % 500 > A])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print('No'if int(input())%500>int(input())else'Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
for a in range(A+1):
    for j in range(21):
        if a + 500 * j == N: 
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#88a
n=int(input())
a=int(input())
temp=n%500
print('Yes' if temp<=a else 'No')

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
N=int(input())
A=int(input())
for i in range(0,20):
  if N >= 500:
    N=N-500
  else:
    break
if(N<=A):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/python3

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input());a=int(input())
n-=500*(n//500)
if a>=n: print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
n = 2
N = []
for i in range(n):
    N.append(int(input()))
if (N[0] % 500) <= N[1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=[]
for i in range(2):
    x.append(int(input()))
#print(x)
y = x[0]%500
#print(y)
if y<=x[1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
if n % 500 == 0:
    print("Yes")
elif n % 500 - a <= 0:
    print("Yes")    
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    n = int(input())
    # 1円は1000枚まで, 500円は無限
    a = int(input())
    amari = n % 500
    if amari - a <= 0:
        print("Yes")
    else:
        print("No")
solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# cook your dish here
n=int(input())	
a=int(input())	
 
if a >= 499:
    print('Yes')
else:
    if n%500>a:
        print('No')
    else:
        print('Yes')

Submission status: Accepted

Solution code:
money = int(input())
number_money = int(input())

division = money // 500
difference = money - 500*division
if difference <= number_money:
    print("Yes")

else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

num = N%500

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
a=int(input())
print(['No','Yes'][n-(n//500)/(1/500)-a<=0])

Submission status: Accepted

Solution code:
a = int(input())
c = int(input())
b = 0
 
b = a% 500
if c >= b:
    print('Yes')
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

print(['No', 'Yes'][n%500 <= a])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 15 11:27:37 2018

@author: Yuya
"""

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

nokori=N%500

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
a = N - 500 * (N // 500)
if a <= A:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

# 500円のみで払える
if N / 500 == 0:
    print("Yes")
# 1円を使う
else:
    # 500の剰余を出して、手持ちの1円で払いきれるか判断
    mod = N % 500
    if A >= mod:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

number = int(input())
a = int(input())

if a >= 499:
  print("Yes")
  sys.exit()

for i in range(a + 1):
  if number % 500 == i:
    print("Yes")
    sys.exit()

print("No")

Submission status: Accepted

Solution code:
pay = int(input())
money_one = int( input() )

if( money_one >= pay%500 ):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
while True:
    N = int(input())
    A = int(input())
    if (N >= 1 and N <= 10000) and (A >= 0 and A <= 1000):
        break

if (N / 500) > 0:
    x = N % 500
    if A >= x:
        print('Yes')
    else:
        print('No')
else:
    if A >= N:
        print('yes')
    else:
        print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
pay = int(input(''))
yen1 = int(input(''))
amari = pay % 500
if yen1 >= amari:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())  # total payment amount
A = int(input())  # the amount of 1 Yen

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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