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

Submission status: Accepted

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

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

Submission status: Accepted

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

while n >= 500:
    n -= 500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print('Yes' if 500*(n//500) + a >= n else 'No')

Submission status: Accepted

Solution code:
# ABC088 A - Infinite Coins
n = int(input())
a = int(input())

for i in range(a+1):
    for j in range(21):
        if i + 500*j == n:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
# ARC 088 A

def resolve():
  n = int(input())
  a = int(input())

  b = n % 500

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


if __name__ == "__main__":
    resolve()

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

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

Submission status: Accepted

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

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

#1円玉を500枚以上持っていたら任意のNで支払い可能
if A>=500:
    print("Yes")


#500枚未満の場合
else:
    if N%500<=A:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

a = int(input())

surplus = n % 500

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

Submission status: Accepted

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

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

Submission status: Accepted

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

solve()

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 sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

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

nmod=N%500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 入力を受け取る
N = int(input())
A = int(input())

# 必要な500円玉の枚数を求める
num_500 = int(N / 500)

# ぴったりN円払うのに必要な1円玉の枚数を求める
nec_1 = N - (500 * num_500)

# ぴったり払えるか判定する
if nec_1 <= 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())%500
a=int(input())
if n<=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:
a=int(input())
b=int(input())
amari=a%500
if amari<=b:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
#N,A =  map(int,input().split())
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())
x = N - (500*(N//500))
if x <= 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<=A :
    print('Yes')
elif N%500<=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())
for i in range(a):
    if n%500==0:
        break
    else:
        n-=1
print('Yes' if n%500==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:
yen=int(input())
one=int(input())
yen%=500
if yen<=one:
  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())
    
    r = N % 500
    if r <= 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:
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""


N =  int(sys.stdin.readline())
A =  int(sys.stdin.readline())

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

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if N>=500 and N-500*int(N/500)<=A:
    print('Yes')
elif N<500 and A>=N:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
if 1 <= n <= 10000 and 0 <= a <= 1000:
    if a >= 499:
        print('Yes')
    elif a >= n % 500:
        print('Yes')
    else:
        print('No')
else:
    print('hoge!')

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

remain = n % 500
judge = remain - a

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if one >= pay%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())

flag = True
for a in range(A+1):
  if (N-a)%500 == 0:
    print('Yes')
    flag = False
    break
if flag:
  print('No')

Submission status: Accepted

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

res = N%500

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
a = int(input())
if n-(int)(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("No")
else:
    print("Yes")

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, a = (int(input()) for _ in range(2))
print('No' if n%500 >a else 'Yes')

Submission status: Accepted

Solution code:
import sys
from statistics import *
from collections import *
from operator import itemgetter
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

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

Submission status: Accepted

Solution code:
n = list(map(int , input().split()))
B = list(map(int , input().split()))
amari =  n[0]%500
if amari - B[0]  <= 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

W = N % 500

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

Submission status: Accepted

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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#coding:UTF-8

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

left_N = N % 500
if N % 500 == 0:
  #まず500円だけの簡単バージョン
  print("Yes")
elif left_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())
n1 = n - int(n / 500) * 500
if n1 == 0:
  print("Yes")
else:
  if n1 <= a:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

q = n % 500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
coinsize = int(input())
yes = False

if coinsize is 0:
    if(N % 500 is 0):
        print("Yes")
        yes = True
        
else:
    for i in range(coinsize):
#    print("aaa")
        if((N - 1*i) % 500 is 0):
            print("Yes")
            yes = True
            break
    
if yes is False:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/

import math
import statistics

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:
        return "Yes"
    return "No"
    
if __name__ == '__main__':
    print(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())

n %= 500

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

Submission status: Accepted

Solution code:
pay = input()
oney = input()

print('Yes' if (int(pay) % 500) <= int(oney) 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())

n = n%500

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

Submission status: Accepted

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

#1円玉で支払う金額
need = n % 500

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

Submission status: Accepted

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

N = N % 500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print("Yes" if N==(((N//500)*500) + (N%500)) and N%500 <= A else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


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

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    test()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print('Yes'if 0<=int(input())%500<=int(input()) 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, A = [int(input()) for _ in range(2)]
print('YNeos'[(N%500)>A::2])

Submission status: Accepted

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

S = N%500

print("Yes") if A >= S else print("No")

Submission status: Accepted

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

q, mod = divmod(N, 500)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(a):
    n -= 1

if n > 0:
    print("No")
else:
    print("Yes")

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

Submission status: Accepted

Solution code:
n, a =map(int, open(0))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
num = 0
while N - 500*num >= 0:
  num += 1
num1 = N - 500 * (num-1)
if num1 <= A:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,A =map(int,open(0).read().split())
print("Yes" if N//500*500+A >= N else "No")

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if A >= N % 500:
    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') 

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

Submission status: Accepted

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

if N % 500 > A:
    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,a=map(int,[input() for i in range(2)])
ama=n%500
if ama-a<=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
total = int(input())
one_yen_coins = int(input())

print("Yes" if total % 500 <= one_yen_coins 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())

s = N % 500

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

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

Submission status: Accepted

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

N %= 500

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

Submission status: Accepted

Solution code:
n = int(input())

a = int(input())

tmp = n % 500

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

Submission status: Accepted

Solution code:
#88

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
print('No' if max(int(input()) % 500 - int(input()), 0) else 'Yes')

Submission status: Accepted

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

ans = N % 500
if max(ans - A, 0):
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input()) #目的
A = int(input()) #1円の枚数

#500円で払える箇所まで割る
amari = N % 500
#print(int(amari))


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

Submission status: Accepted

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

B=N%500

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

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

Submission status: Accepted

Solution code:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac

setrecursionlimit(1000000)


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

def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(l):
	x = l.pop()
	y = l.pop()
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	l.append(min(x,y))
	return gcd(l) if len(l) > 1 else l[0]

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

main()

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()) % 500 # N:払いたい金額
A = int(input()) # A:1円玉の保持数
print("No" if n > A else "Yes")