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

for i in range(a + 1):
    if (n - i) % 500 == 0:
        print("Yes")
        quit(0)
    else:
        continue

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:
x = int(input())
y = int(input())
for i in range(y+1):
  if x - (int(x/500)*500 + i) == 0:
    print('Yes')
    break
  elif i == y:
    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:
  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:
i1 = int(input())
i2 = int(input())

w = i1%500
if w <= i2:
  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:
import math
n = int(input())
a = int(input())
n1 = math.floor(n / 500)
if n - (n1 * 500 + a) <= 0:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
a = int(input())
flag = False

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
if n<a:
    print("Yes")
    exit()
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")

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, A: int):
    if (N % 500) <= A:
        print(YES)
    else:
        print(NO)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    solve(N, A)


if __name__ == '__main__':
    main()

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n, a = IR(2)
    n %= 500
    if a >= n:
        print("Yes")
    else:
        print("No")
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

# print(N)
# print(A)

# print(N % 500 < A)

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
a=int(input())
t=n%500
#print(t)
if (t<=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:
def main():
	N = int(input())
	A = int(input())
	div = N//500
	ans = N - div*500
	if ans <= A:
		print("Yes")
	else:
		print("No")


if __name__ == '__main__':
	main()

Submission status: Accepted

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

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

# solve
ans = 'Yes' if N % 500 <= A else 'No'

# output
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
if N <= A:
    print("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("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==0:
  print("Yes")
elif 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:
row = [input().split() for i in range(2)]
n = int(row[0][0])
a = int(row[1][0])
surplus = n % 500
if surplus <= 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())

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = a-500*(a//500)

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

Submission status: Accepted

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

while True:
    if N - 500 >= 0:
        N -= 500
    else:
        break

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())    #金額
a = int(input())    #硬貨枚数

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding: utf-8
n = int(input())
a = int(input())
rest = n % 500

if a - rest >= 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print("Yes") if a >= (n % 500) else 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 python3
# -*- coding: utf-8 -*-

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

remainder = n % 500

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N = n()
A = n()

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

Submission status: Accepted

Solution code:
import sys
from collections import Counter, deque, defaultdict
from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
from functools import reduce
from math import ceil, floor, log10, log2, factorial
from pprint import pprint

sys.setrecursionlimit(1000000)
# MOD = 10 ** 9 + 7
# N = int(input())
# A = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]
# 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:
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())
if N % 500 <= 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, a = int(input()), 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:
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    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:
Nyen = int(input())
Amai = int(input())

if Nyen % 500 <= Amai:
	print('Yes')
else:
  	print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(N: int, A: int):
    print( YES if N % 500 <= A else NO )
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    solve(N, A)

if __name__ == '__main__':
    main()

Submission status: Accepted

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


abc()

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

#n%500


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:
# -*- coding: utf-8 -*-

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

r = n%500

if r<=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:
siharai = int(input())
maisuu = int(input())

#zan = siharai - maisu

zan =siharai // 500

if siharai - 500*zan <= maisuu  :
  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:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)

    # N の逆元
    # N_inv = pow(N,MOD-2,MOD)

    # nCr
    # Nの階乗 * rの階乗の逆元 * n-rの階乗の逆元
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")

    # 大きな素数
    MOD = 10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N = int(input())
    A = int(input())
    N = N % 500
    if N > A:
        print('No')
    else:
        print('Yes')
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    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
if b<=a:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019/06/02
# AtCoder Beginner Contest 088 - A 

# Input
n = int(input())
a = int(input())

w_coin = n % 500

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

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

Submission status: Accepted

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

Submission status: Accepted

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

amari = n % 500

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

Submission status: Accepted

Solution code:

def solve(n,a):
    if n == 0:
        return print("Yes")
    elif n>=500:
        n = n - 500*(n//500)
        return solve(n,a)
    elif n > a:
        return print("No")
    else:
        return print("Yes")

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

Submission status: Accepted

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

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(N: int, A: int):
    if N % 500 <= A:
        ret = YES
    else:
        ret = NO
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    solve(N, A)

if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

input = sys.stdin.readline

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

main()

Submission status: Accepted

Solution code:
#r,g,b = map(str, input().split())
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())

mod = N % 500

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

Submission status: Accepted

Solution code:
shiharai = int(input())
one = int(input())

if shiharai % 500 - one <= 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

x=n%500

if a>=x:
    print("Yes")

else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


class UnionFind:

    def __init__(self, n):
        self.parent = [i for i in range(n)]

    def root(self, i):
        if self.parent[i] == i:
            return i
        self.parent[i] = self.root(self.parent[i])
        return self.parent[i]

    def unite(self, i, j):
        rooti = self.root(i)
        rootj = self.root(j)
        if rooti == rootj:
            return
        if rooti < rootj:
            self.parent[rootj] = rooti
        else:
            self.parent[rooti] = rootj

    def same(self, i, j):
        return self.root(i) == self.root(j)


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


def main():
    n = intin()
    a = intin()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

max_500 = N//500


list = []


for i in range(max_500 + 1):
    for j in range(A + 1):
        if  500 * i + j == N:
            list.append(j)

if len(list) >= 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input().strip()) % 500
a = int(input().strip())
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')



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if A > 0:
  for i in range(A):
    if N % 500 == i:
      print("Yes")
      exit()
  
  print("No")
else:
  if N % 500 == 0:
    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())
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())

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


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

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

Submission status: Accepted

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

Submission status: Accepted

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

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