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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

def main():
    n = int(input())
    a = int(input())
    if a - (n - (500 * (n // 500))) >= 0:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import re
import sys
from collections import *
from functools import lru_cache
from heapq import *
from itertools import *

INF=float('inf')

sys.setrecursionlimit(2**31-1)

rfs=lambda:rl().split()
ri=lambda:int(rl())
ris=lambda:list(map(int,rfs()))
rl=lambda:next(sys.stdin)
rrs=lambda:list(map(str.strip,sys.stdin))
rs=lambda:rl().strip()
rt=lambda:sys.stdin.read()
rg=lambda:list(map(list,rrs()))

def n4(i,j):
    return [
                (i-1,j),
        (i,j+1),        (i,j-1),
                (i+1,j),
    ]

def n8(i,j):
    return [
        (i-1,j-1),(i-1,j),(i-1,j+1),
        (  i,j-1),        (  i,j+1),
        (i+1,j-1),(i+1,j),(i+1,j+1),
    ]

inb=lambda i,j,m,n:0<=i<m and 0<=j<n

###########################################

N,A=ri(),ri()
if N%500-A<=0:
    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=int(input())
A=int(input())

while N>=500:
    N-=500

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, A = map(int, read().split())

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

    return


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());print('YNeos'[n%500>a::2])

Submission status: Accepted

Solution code:
n,a=map(int,open(0).read().split())
print('YNeos'[n%500>a::2])

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

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
flag=0
for i in range(10001):
    for j in range(A+1):
        if N==500*i+j:
            flag=1
if flag==0:
    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())
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 = 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=N%500
if mod<=A:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

max_B = 10000//500

boolian = False

for b in range(max_B+1):
    if boolian == True:
        break
    for a in range(A+1):
        someone = 500*b + a 
        if someone == N:
            boolian = True
            break
        if someone != N:
            boolian = False
            continue
            
if boolian == True:
    print('Yes')
if boolian == False:
    print('No')

Submission status: Accepted

Solution code:
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = INT()
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())

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

t = n % 500

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
#-------------
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())

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

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 a - n%500>=0 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())
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())
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())
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:
print('NYoe s'[eval(input()+'%500<='+input())::2])

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 a >= n:
    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,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 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())
n5 = int(N/500)
a = N - n5 * 500
if a <= 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())
for i in range(A+1):
    for j in range(21):
        if 500*j+i==N:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

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

A_l = A % 500

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

Submission status: Accepted

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


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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
l = [int(input())for i  in range(2)]
print(['Yes','No'][(l[0]% 500 > l[1])])

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

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

Submission status: Accepted

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

while n >= 500:
    n -= 500

if n <= a:
    print('Yes')
elif n == 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:
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")

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

N = input()
A = input()

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
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)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
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')

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

Submission status: Accepted

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

Submission status: Accepted

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

if n%500==0 or 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:
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()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

pay500 = N

while pay500 >= 500:
    pay500 = pay500 - 500

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

else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

q = N % 500

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

res = n % 500

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

    return 'No'

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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 = n % 500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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