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

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

Submission status: Accepted

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

if N %500 == 0:
    print("Yes")

#もしNが９９９９だったら、５００円硬貨１９枚と１円硬貨が４９９枚数によって支払い可能。
#その４９９の算出方法は9999を５００で割った時の余り、つまりN％５００　
#この時、Aがもし４９９以上だったら支払い可能だが、４９８以下だったら不足しており支払い不可。
    
elif N %500 <= A:
    print("Yes")

else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

c = 0


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
amount = int(input())
n_1yen = int(input())

fraction = amount % 500

if fraction <= n_1yen:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
print('YNeos'[(int(input())%500)>int(input())::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())

i = n % 500

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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:
#!/usr/bin/env python3

import sys
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1             # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    a = ii()
    print('Yes') if n % 500 <= a else print('No')


if __name__ == "__main__":
    main()

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()) % 500
if int(input()) >= N:
  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 li():
    return list(map(int, input().split()))


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


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


N = ii()
A = ii()

modN500 = N % 500

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

Submission status: Accepted

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

q, r = divmod(N, 500)

if r <= 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())
b = n % 500
c = a - b
if c >= 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())
print('Yes' if n%500<=a else '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:
#infinity Coins
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:
N = int (input())
A = int (input())

B = N % 500

if 0<=B<=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")
    exit()

print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
 
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
 
def main():
  N = int(input())
  A = int(input())
  if N % 500 <= A:
    print('Yes')
  else:
    print('No') 
 
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

#文字列を一文字ずつ取得したいとき
def inputStrOnebyOne():
    s = list(input())
    return s

#整数を一つずつリストに入れる
def inputOnebyOne_Int():
    a = list(int(x) for x in input().split())
    return a

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

Submission status: Accepted

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

Submission status: Accepted

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

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

resolve()

Submission status: Accepted

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

  return

if __name__ == "__main__":
  resolve()

Submission status: Accepted

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

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

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

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

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 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:
# -*- coding: utf-8 -*-
n = int(input())
a = int(input())

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

Submission status: Accepted

Solution code:
N, A = map(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())

N2= N  %  500;

if N2 <= 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:
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 print ("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 標準入力の取得
N = int(input())
A = int(input())


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

    # 結果出力
    print(result)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 標準入力の取得
N = int(input())
A = int(input())

# 求解処理
result = str()
if (N % 500) <= A:
    result = "Yes"
else:
    result = "No"

# 結果出力
print(result)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

a = n1%500

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

Submission status: Accepted

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

c = a % 500

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

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 - (n // 500) * 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:
import sys
import math
import bisect

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':

    ABC_88_A()

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
A_need = N % 500
A = int(input())
print('Yes' if A_need <= 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:
def main():
    n,a = (int(input()) for _ in range(2))
    print('Yes' if n%500 <= a else 'No')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
N = ri()
A = ri()
print('Yes' if N % 500 <= A else 'No')

Submission status: Accepted

Solution code:
def actual(amount, n_1yen):
    fraction = amount % 500

    if fraction <= n_1yen:
        return 'Yes'
    else:
        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())

_, m = divmod(N, 500)

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

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:
print(['No', 'Yes'][int(input()) % 500 <= int(input())])

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

cnt = N//500
if(N-cnt*500<=A):
    print("Yes")
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 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:
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 (0,0)]
print("YNeos"[n%500>a::2])

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

Submission status: Accepted

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

print('Yes' if N <= 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")


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:
# 2問目類題２
N,A =[int(input()) for i in range(2)]
if 0 <= (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:
#!/usr/bin/env python3

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

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

Submission status: Accepted

Solution code:
money = int(input())
one = int(input())
while money / 500 >= 1:
    money -= 500
if money <= one:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    A = int(_in[1])  # type:int
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    TF = 'Yes' if N%500<=A else 'No'
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(TF)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

def resolve():
    def main():
        n=int(input())
        a=int(input())
        for i in range(21):
            for j in range(a+1):
                if 500*i+1*j==n:
                    return 'Yes'
        return 'No'
    print(main())
resolve()

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

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

Submission status: Accepted

Solution code:
#data = map(int,input().split())
data = [int(input()),int(input())]

if data[0] % 500 <= data[1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC088A

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

mod = N % 500

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    # 整数 1 つ
    n = int(input())
    a = int(input())
    # 整数複数個
    # a, b, c = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

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


resolve()

Submission status: Accepted

Solution code:
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, groupby
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
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()
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())
NX = N//500
NY = N - NX * 500
if NY <= A:
  print("Yes")
else:
 print("No")

Submission status: Accepted

Solution code:
N=int(input())
A=int(input())
b=N//500
c=N-500*b
if c<=A:
  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 "No")