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: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print('YES' if int(input()) % 500 <= int(input()) else 'NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def hantei(N, A):
    if (N - A) <= 0:
        print("No")
    else:
        if ((N - A) % 100) != 0:
            print("No")
        elif ((N-A) % 100) == 0 and ((N-A) % 500) == 0:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    hantei(N, A)

Submission status: Wrong Answer

Solution code:
import sys

with sys.stdin as f:
    s_input = f.read()

    in_list = s_input.splitlines()
    n = int(in_list[0])
    a = int(in_list[1])

    if n // 500 <= a:
        print("Yes")
    else:
        print("No")
        
sys.exit(0)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(k) for k in input().split()]
a.sort()
s=0
for i in range(len(a)):
    s+=(pow(-1,i)*a[len(a)-1-i])
print(abs(s))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(k) for k in input().split()]
a.sort()
s=0
for i in range(len(a)):
    s+=pow(-1,i)*a[len(a)-1-i]
print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=int(input())
n-=(n%500)
if (n<a) :
    print("yes")
else :
    print("no")

Submission status: Wrong Answer

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

if n<500:
    if n<=a:
        print("Yes")
    else:
        print("No")
elif n>500 and (n//500)<=a:
    print("Yes")
else :
    print("No")

Submission status: Wrong Answer

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

if n<500:
    if n<=a:
        print("Yes")
    else:
        print("No")
elif n>a and (n//500)<=a:
    print("Yes")
else :
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if A >= N:
    print("Yes")
else:
    n = N % 500
    if n != 0 and A >= n:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
N = input("1<=N<=100000の整数を入力せよ")
A = input("0<=A<=1000の整数を入力せよ") 
x= int(N)%500
if x <= int(A):
    print ("Yes")
else :
    print ("No")

Submission status: Wrong Answer

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

if A >= N:
    print("yes¥n")
else:
    n = N % 500
    if n != 0 and A >= n:
        print("yes¥n")
    else:
        print("no¥n")

Submission status: Wrong Answer

Solution code:
#-*-cording:utf-8-*-
N = int(input())
A = input().split()
A.sort()
A.reverse()
a=list(map(int,A))
Alice = a[1::2]
Bob = a[0::2]
allA=sum(Alice)
allB=sum(Bob)
Ans=allA-allB
print(Ans)

Submission status: Wrong Answer

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

if A >= N:
    print("yes")
else:
    n = N % 500
    if n != 0 and A >= n:
        print("yes")
    else:
        print("no")

Submission status: Wrong Answer

Solution code:
#-*-cording:utf-8-*-
N = int(input())
A = input().split()
A.sort()
A.reverse()
a=list(map(int,A))
Alice = a[1::2]
Bob = a[0::2]
allA=sum(Alice)
allB=sum(Bob)
Ans=allA-allB
print(-Ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(raw_input())
A = int(raw_input())
if N%500 <= A:
    print "yes"
else:
    print "no"

Submission status: Wrong Answer

Solution code:
N = int(input())
A = int(input())
if N < 500:
    if N <= A:
        print("yes")
    else:
        print("no")
else:
    t = N%500 #tはあまり
    if t <= A:
        print("yes")
    else:
        print("no")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

n = n % 500

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

Submission status: Wrong Answer

Solution code:
n = "2018"
a = "0"
n = int(n)
a = int(a)

n = n % 500

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

Submission status: Wrong Answer

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

n = n % 500

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

Submission status: Wrong Answer

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

n=n-a

if n//500==0:
    print("Yes")
else :
    print("No")

Submission status: Wrong Answer

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

n=n-a

if n//500==0:
    print("YES")
else :
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

input_lines=input()
price=int(input_lines)

input_lines=input()
coins=int(input_lines)

price=2018
coins=218

frac=price%500

if frac>coins:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if a == 0 and n%500 != 0:
    print("No")
elif n%500==0:
    print("Yes")
elif n%500 < a or n%500 == a:
    print("Yes")
else:
    pass

Submission status: Wrong Answer

Solution code:
N = int(input())                                                                                                                    
A = int(input())
i = 0 
while(N >=500):
    N//=500
if(N <=A):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#金額
total = int(input())
oneN = int(input())

num = oneN - (total % 500)

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

Submission status: Wrong Answer

Solution code:

def main():
    N = int(input())
    a = int(input())

    r = N%500

    if r == 0:
        print ('yes')
    elif a >= r:
        print ('yes')
    else:
        print ('No')


if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:

def main():
    N = int(input())
    a = int(input())

    r = N%500

    if a >= r:
        print ('yes')
    else:
        print ('No')


if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()

Submission status: Wrong Answer

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

a = N%500;

if A - a > 0:
	print ("Yes")

else:
	print("No")

Submission status: Wrong Answer

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

if 2018 % 500 <= a:
    ans = 'Yes'
else:
    ans = 'No'

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n=int(raw_input())
a=int(raw_input())
while n>=0 and a>0:
	n-=1
	if n%500==0:
		print "Yes"
		exit(0)
	a-=1
print "No"

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = int(input())
t = N%500 #tはあまり
if t <= A:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
f = lambda :[int(i) for i in input().split()]

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=int(input())
print(['No','Yes'][a-(n%500)>0])

Submission status: Wrong Answer

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Amari=N%500

if A>=Amari:
    print('Yes')

elif A<Amari:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a = N % 500

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

mod = total_price % 500

if num_one_coin >= mod:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(2)]
if(a[0]%500 <= a[1]): 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):
    return YES if (N % 500) <= A else NO


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
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
    print(solve(N, A))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    A = int(readline())

    x = N % 500

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
cnt = 0
for i in range(21):
  if 0 <= n - i*500 and n - i*500 <= a:
    print("Yes")
    break
  else:
    cnt += 1
    if cnt == 21:
      print("No")
      break

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:
import sys
N, A = map(int, sys.stdin.readlines())
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' , flush=True)
else:
    print('No' , flush=True)

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, a = int(input()), int(input())
flg = n % 500 - a > 0

print('No' if flg else '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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
s=n%500
if a>=s:
  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())
 
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:
#!/usr/bin/env python3


def main():
    N, A = map(int, open(0).read().split())
    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())
if n - 500*(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())
n -= n//500 * 500
if n <= a:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# vim: fileencoding=utf-8


def main():
    N = int(input())
    A = int(input())
    x = N % 500
    if A >= x:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

nokori = N % 500

if nokori <= 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())

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

Submission status: Accepted

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

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

remainder = N % 500
if A > remainder or remainder==0:
    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 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:
import sys
n = int(input())
a = int(input())
b = 0
while True:
    c = 0
    if (500*b + c) > n:
        print("No")
        break
    for i in range(a+1):
        if (500*b + c) == n:
            print("Yes")
            sys.exit(0)
        c+=1
    b+=1

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, 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())
amari = N % 500
if amari > 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())
ret = 'No'
for a in range(A+1):
  if N%500==a:
    ret='Yes'
    break
print(ret)

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

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

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:
#
# abc088 a
#

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2018
218"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """2763
0"""
        output = """No"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """37
514"""
        output = """Yes"""
        self.assertIO(input, output)


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


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Accepted

Solution code:
print('YNeos'[eval(input()+'%500>'+input())::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,a=[int(input()) for _ in range(2)]
print('NYoe s'[n%500<=a::2])

Submission status: Accepted

Solution code:
n,a=[int(input()) for _ in range(2)]
print('NYoe s'[n<=a or n%500<=a::2])

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

b = n % 500

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N, A = list(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('No')
else:
    print('Yes')

Submission status: Accepted

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