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


def main():
    n = int(input())
    a = int(input())
    # i = list(map(int,input().split()))
    # j = list(map(int,input().split()))

    check = n % 500
    # print(check)

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


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

Submission status: Accepted

Solution code:

def Infinite_Coins(n , a):

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

def main():
    n = int(input())
    a = int(input())
    print(Infinite_Coins(n , a))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())#支払額
A = int(input())#1円の所持数
B = N % 500
if A >= B:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

total = 0
while True:
    total += 500
    if total > N:
        if total - 500 + A >= N:
            print('Yes')
        else:
            print('No')
        break
    elif total == N:
        print('Yes')
        break

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:
# 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:
#088_A
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:
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:
n = int(input())
a = int(input())

x = (n // 500) * 500
if n // 500 >= 1:
    if n - x <= a:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
elif n <= a:
    print("Yes")
    exit()


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

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

Submission status: Accepted

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

num = N % 500

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print("Yes" if a >= n - 500*(n//500) 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:
# import numpy as np
# import scipy as sp
# import sys
# input = sys.stdin.readline
# print(a,b,c,sep="") # 半角スペースなしで出力(abc)
# n=int(input())  #数値入力 「N」だけの入力のとき
# a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
# a=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
# a=[int(input()) for _ in range (n)]  #リスト入力  改行でa1 ... anのとき
# s=[list(map(str,list(input()))) for i in range(h)]  # 文字列の二次元配列入力
# s = [list(map(int, input().split())) for i in range(n)] # 数値の二次元配列入力
# a = b[:], a = [x[:] for x in b] # deepcopy
# chr(ord('a') + 1) # chrのインクリメント
# s.sort(key=lambda x: x[1], reverse=False) # 2番目の要素で昇順にソート（Trueなら降順）
#　

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

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

Submission status: Accepted

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

remain = N % 500

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = "No"

tmp = X%500

if tmp <= A:
  ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
x = a%500
if x <= 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:
# -*- coding: utf-8 -*-

N = int(input().strip())
A = int(input().strip())


count_500 = N // 500
N_remain = N % 500

count_1 = N_remain

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

Submission status: Accepted

Solution code:
def main():
    cost = int(input())
    one_yen = int(input())
    if (cost - cost // 500 * 500) <= one_yen:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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


x = n % 500

if x <= a:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
n,m=open(0)
n,m=int(n)%500,int(m)
print( "Yes" if n%500<=m else "No")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

s = x % 500
if a >= s:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
print('No')if int(input())%500>int(input())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:
# 入力 : 数字2つ、別々に
N = int(input())
A = int(input())

# 出力 Yes or No
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:
try:
    N = int(input())
    A = int(input())

    if N%500!=0:
        mod = N%500
        print('Yes' if A>mod else 'No')
    else:
        print('Yes')
except EOFError:
    pass

Submission status: Accepted

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

n , _ = divmod(N, 500) 
# print(n)
remain = N-500*n

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# AL006 A

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

if n > (500 * (n // 500)) + a:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

b = n % 500

if a >= b:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
modN = N % 500
if modN <= 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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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

n = N % 500

if A >= n:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())  #数値入力 「N」だけの入力のとき
a=int(input())  #数値入力 「N」だけの入力のとき
if n % 500 <= a:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
N = 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:
a=int(input())
b=int(input())
print("Yes" if a%500 - b <= 0 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())
b = n-500*int(n/500)
if a>=b:
  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 a >= n%500:
  print('Yes')
else:
  print('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:
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, A = map(int, read().split())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
v = n - (500 * (n // 500))

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

Submission status: Accepted

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

def main():
    for i in range(0, A+1):
        if (N - i) % 500 == 0:
            print('Yes')
            return
    print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
A = int(input())
# 500円を使った場合のあまりを計算
r = N % 500
# あまりがAより小さければYes
ans = "Yes" if r <= A else "No"
# 結果を表示
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())

r = N % 500

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

Submission status: Accepted

Solution code:
N=int(input())
A=int(input())
count=0
for i in range(0, A+1):
    if (N-i)%500 == 0:
        count=1
        break
print("Yes" if count==1 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())%500
a = int(input())
if n <= a:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
print("YNeos"[not N%500<=A::2])

Submission status: Accepted

Solution code:
a,b = (int(input()) for _ in range(2))
print("Yes" if a%500<=b else "No")

Submission status: Accepted

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

Submission status: Accepted

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

a = 0
for i in range(20):
  if N >= 500*(i+1):
    a =  500*(i+1)
  else:
    continue
    
b = N - a

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:


import numpy as np

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

Submission status: Accepted

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

    x = n % 500

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
print('NYoe s'[(int(input())%500)<=int(input())::2])

Submission status: Accepted

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

Submission status: Accepted

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

#500円だけで払えない余り
amari = N % 500

#余りより1円玉の枚数が多ければ良い
if A >= amari :
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = input()
a = int(input())
si = int(n[-3:])

if si > a:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:

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

S = (N - int(N / 500) * 500)

if S <= A:
  print('Yes')
  
elif S > A:
  print('No')

Submission status: Accepted

Solution code:
n=int(input())
a=int(input())
m=n%500-a
if m<=0:
    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 a>=b:
    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:
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def gcd(a,b): #最大公約数
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def lcm(a,b): #最小公倍数
    return a/gcd(a,b)*b

def divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): #素数判定
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): #素数列挙
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def prime_fact(a): #素因数分解
    sqrt = math.sqrt(a)
    res = []
    i = 2
    if is_prime(a):
        res.append(a)
    else:
        while a!=1:
            while a%i==0:
                res.append(i)
                a //= i
            i += 1
    return res

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

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

Submission status: Accepted

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

diff = N % 500
print("Yes" if diff <= yen 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())
 
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 = input()
A = int(input())
n = int(N)
x = 0

if n > 100:
    x = int(N[-3])
    if x >= 5:
        x = x - 5

y = int(N[-2])
z = int(N[-1])
X = x * 100 + (y * 10) + z

if n <= A or X <= A:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

pay = N%500

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
A = int(input())
if A-N%500 < 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("No")
else:
    print("Yes")

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

Submission status: Accepted

Solution code:
# coding: utf-8


def main():

    payment = int(input())
    number_of_1 = int(input())

    if (payment % 500) <= number_of_1:
        print('Yes')
    else:
        print('No')

    return 0


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = n - int(n / 500) * 500
if (x <= 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:
from sys import stdin
#stdin = open("input.txt")

if __name__ == "__main__":
    N = int(stdin.readline())
    A = int(stdin.readline())
    
    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
import sys


def main():
  n = int(input())
  a = int(input())
  
  if n % 500 != 0 and a == 0:
    print('No')
  
  elif (n - (n // 500) * 500) <= a:
    print('Yes')
    
  else:
    print('No')
  
  return 0


if __name__ == '__main__':
  main()

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

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:
y = int(input())
i = int(input())

z = y%500
if z <= i:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

n, a = map(int, sys.stdin.read().split())

def main():
    return 'Yes' if a >= n % 500 else 'No'

if __name__ == '__main__':
    ans = main()
    print(ans)

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:

##Just for prctice
N=int(input())

A=int(input())

for i in range(A+1):
    if (N-i)%500==0:
        print("Yes")
        break
    elif i==A:
        print("No")


"""
2018
218

Yes

2763
0

No

37
514

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

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