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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

k=N%500

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n = f()[0]
    a = f()[0]

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

solve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,a = map(int,open(0).read().split())
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:
N = int(input())
A = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
hasuu = n % 500
if hasuu <= a:
    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("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:


def read_input():
    n = int(input())
    a = int(input())
    return n, a


def submit():
    n, a = read_input()

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


if __name__ == '__main__':
    submit()

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
if a > b and (a%500) <= b:
  print("Yes")
elif b >= 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:
n,a=[input() for i in range(2)]
[print("Yes") if (int(n)%500)<=int(a) 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("No")
else:
    print("Yes")

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

N_new = N%1000

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

n, a = [int(input()) for _ in range(2)]

n %= 500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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 b >= a % 500:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

N = int(input())
S = int(input())

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

Submission status: Accepted

Solution code:
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper

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

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:
# ABC088A - Infinite Coins
n, a = [int(input()) for _ in range(2)]
print("Yes" if n % 500 <= a else "No")

Submission status: Accepted

Solution code:
n = input()
c = input()
if n % 500 <= c:
    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())
print('Yes') if n%500 <= a 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:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'Yes' if n%500 <= a else 'No'

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input()) # 支払額
A = int(input()) # 1円玉の数	

yen = N % 500

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

Submission status: Accepted

Solution code:
# coding:UTF-8
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 a>=(n%500):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

c = n // 500

one = n - c*500

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

Submission status: Accepted

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

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

Submission status: Accepted

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

m=n%500
print "YNeos"[a<m::2]

Submission status: Accepted

Solution code:
N, A = int(input()), int(input())
print(["Yes", "No"][not(N % 500 <= A)])

Submission status: Accepted

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

x = N%500

if(x<=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:
n = int(input())
a = int(input())
nmod = n % 500
if nmod <= 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:
n1 = int(input())
n2 = int(input())
 
if n1%500<=n2:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#088 A
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())
x=n%500
if a>=x:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
a=int(input())
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 <= 0:
    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())

ans = n % 500

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

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

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

Submission status: Accepted

Solution code:
N,A=eval('int(input()),'*2)
while True:
    if N >= 500:
        N-=500
    else:
        break
print('Yes' if A>=N 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('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline

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

if N <= 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:
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 = map(int, [input() for i in range(2)])

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

Submission status: Accepted

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
#
import sys
import math


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

Submission status: Accepted

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

p = N % 500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

c = N % 500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

a=N%500
if A>=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 n%500<=a else "No")

Submission status: Accepted

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

Submission status: Accepted

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


main()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit
# A,B,C = [int(n) for n in input().split()]
N = int(input())
A = int(input())
if (N%500<=A): print("Yes")
else: print("No")

exit()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

print( 'Yes' if a%500 <= b 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 = int(input())
A = int(input())

if int(N % 500) <= A:
    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:
def infinite_coins(N: int, A: int) -> bool:
    return N % 500 <= A


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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc088/tasks/abc088_a

import itertools
import collections
import bisect

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

res = N%500
if A >= 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:
import sys

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# A
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('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:
# https://atcoder.jp/contests/abc088/tasks/abc088_a
n = int(input())
a = int(input())
print("Yes") if (n % 500 <= a) 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:
n,a=int(input()),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("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
from sys import stdin
n=int(stdin.readline().rstrip())
a=int(stdin.readline().rstrip())
if a>=n%500:
  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())

ans = N % 500 <= A

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

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
x = N % 500
if x <= 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 <= 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:
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 24 20:12:13 2019

@author: yuta
"""

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

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

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:
a=int(input());b=int(input())
print("YNeos"[a%500>b::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())#total
A=int(input())#1

#500*x+1*A=N
#x is undecided
if(N%500<=A):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

while N >= 500:
    N = N - 500

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

Submission status: Accepted

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

N = I()
A = I()

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

Submission status: Accepted

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

Submission status: Accepted

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

d = n%500

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

Submission status: Accepted

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

num = N % 500

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
while a>=500:
  a-=500
if b>=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())

amari = N%500

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
arr = []
for i in range(2):
  arr.append(int(input()))

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,n =[int(input()) for i in range(2)]
if a%500<=n:
    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())


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

Submission status: Accepted

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

Submission status: Accepted

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

N = N % 500

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