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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

for i in range(21):
  if 0<= n-500*i<=a:
    print("Yes")
    break
else:
  print("No")

Submission status: Accepted

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

b = int(n%500)

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

Submission status: Accepted

Solution code:
def can_pay(n,a):
  n %= 500
  print("Yes") if(n<=a) else print("No")


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

Submission status: Accepted

Solution code:
# Problem https://atcoder.jp/contests/abc088/tasks/abc088_a
# Python 3rd Try
yes = "Yes"
no = "No"


def solver(total, haveOneYen):

    result = False
    oneYenNeed = total % 500
    if oneYenNeed <= haveOneYen:
        result = True
    return result


if __name__ == "__main__":

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect, string
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**7)
inf = float('inf')
mod = 10**9+7
ans = inf ;count = 0 ;pro = 1

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect, string
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**7)
inf = float('inf')
mod = 10**9+7
ans = inf ;count = 0 ;pro = 1

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

Submission status: Accepted

Solution code:
n=input().rstrip() #円
a=input().rstrip() #1円玉の枚数
n,a=int(n),int(a)
b=n%500 #500で割ったあまり
if b>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:
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())
go=n//500
print("Yes" if a>=(n-500*go) else "No")

Submission status: Accepted

Solution code:
n = int(input())  # 代金
a = int(input())  # 1円の枚数

amari = n % 500

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 a >= n else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = [int(input()) for i in range(2)]

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

Submission status: Accepted

Solution code:
# Problem https://atcoder.jp/contests/abc088/tasks/abc088_a
# Python 2nd Try
yes = "Yes"
no = "No"


def canpay(needMoney, oneYen):
    zangaku = needMoney % 500
    if zangaku <= oneYen:
        return True
    else:
        return False


if __name__ == "__main__":

    N = int(input())
    A = int(input())
    result = True
    if canpay(N, A):
        print(yes)
    else:
        print(no)
exit

Submission status: Accepted

Solution code:
g=int(input())
i=int(input())

if g%500 <= i:
  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:
# -*- coding: utf-8 -*-

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

left = N % 500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))

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

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

Submission status: Accepted

Solution code:
# Problem https://atcoder.jp/contests/abc088/tasks/abc088_a
# Python 1st Try
if __name__ == "__main__":
    yes = "Yes"
    no = "No"
    answer = ""
    N = int(input().strip())
    A = int(input().strip())
    chargeCoin = N % 500
    if chargeCoin <= A:
        answer = yes
    else:
        answer = no
    print(answer)
exit

Submission status: Accepted

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

_, r = divmod(N, 500)
if r <= A:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input()) # 支払い金学
A = int(input()) # 1円の枚数
B = N % 500 # ５００円が商枚使われた時の余り、これが１円より多いか少ないかで決める
if B <= A:
  print("Yes")
else:
  print("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())

T = N // 500
U = N - (T * 500)
if U <= 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, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = INT()
left = N % 500
if left <= 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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input().split()[0])
a = int(input().split()[0])
ans = "Yes" if n % 500 <= a else "No"
print(ans)

Submission status: Accepted

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

x=n%500 

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

Submission status: Accepted

Solution code:
import sys

def main():
    n, a = map(int, sys.stdin.read().split())
    print('Yes' if n % 500 <= a else 'No')

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if (N%500)<=A: # 払える場合
    print("Yes")
else: # 払えない場合
    print("No")

Submission status: Accepted

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

x = n%500

if x <= 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, a = open(0).read().split()
if int(n) % 500 <= int(a):
        print("Yes")
else:
        print("No")

Submission status: Accepted

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

#入力
#S = str(input())
#a, b = map(int, input().split())
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())
is_OK = False
for a in range(A + 1):
    if (N - a) % 500 == 0:
        print("Yes")
        is_OK = True
        break
if is_OK == False: 
    print("No")

Submission status: Accepted

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

#枚数
number=(N//500)

#端数を弾く
Rest = (N-(number*500))

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

mod = N % 500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def examA():
    N = I(); A = I()
    ans = "No"
    if N%500<=A:
        ans = "Yes"
    print(ans)


import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

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:
from sys import stdin
from itertools import combinations

n = int(stdin.readline().rstrip())
a = int(stdin.readline().rstrip())

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

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(A+1):
  if (N - i) % 500 == 0:
    print('Yes')
    exit()

print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
A = int(input())
if N % 500 <= A:
  print("Yes")
else: print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
int1 = lambda x: int(x) - 1

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

main()

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 and a>=n:
  print("Yes")
elif n>=500 and 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 sys import stdin
n = int(stdin.readline().rstrip())
a = int(stdin.readline().rstrip())

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

Submission status: Accepted

Solution code:
#                         author:  kagemeka 
#                         created: 2019-11-06 16:18:30(JST)
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics

def main():
    n, a = (int(x) for x in sys.stdin.read().split())
    print('Yes' if n % 500 <= a else 'No')


if __name__ == "__main__":
    # execute only if run as a script
    main()

Submission status: Accepted

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

Submission status: Accepted

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

N = N%500

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# = input()
# = int(input())
# = map(int, input().split())
# = list(map(int, input().split()))
#
N = int(input())
A = int(input())
ans = N % 500
print('Yes' if ans <= A else 'No')

Submission status: Accepted

Solution code:
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()
A=one_int()

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

Submission status: Accepted

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

div, mod = divmod(N, 500)

if mod <= 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:
# -*- coding: utf-8 -*-
N = int(input())
A = int(input())
C500 = int(N/500)
if(A >= N - C500*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:
# A - Infinite Coins
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-(N//500)*500 <= A else '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())
q = N % 500
if q <= 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())

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())
ama = n % 500
if ama <= 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())
L = N // 500

if N - (L * 500) - A <=0:
    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 - (N // 500) * 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())

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 24,Oct,2019
"""

import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline().rstrip())
A = int(readline().rstrip())


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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
i = int(1)
K = int(0)
B = int (N%500)

while i <= A:
    if(B == i):
      K = i
      break
    else:
      i += 1

if(K!=B):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,A=int(input()),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:
#
# abc088 a
#
import unittest
from io import StringIO
import sys


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


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


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)


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

Submission status: Accepted

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

mod = N % 500

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

Submission status: Accepted

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

while A >= 500:
  A = A - 500

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

Submission status: Accepted

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

sum = 0

while True:
  if sum > N:
    sum -= 500
    break
  sum += 500
  
for i in range(A):
  if sum < N:
  	sum += 1
if sum == 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())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,A = map(int,open(0).read().split())

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:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    x=INT()
    a=INT()
    y=x%500
    if a>=y:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
#2019/10/10
N, A = map(int, open(0).read().split())
print("Yes" if N%500 <= A else "No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(2)]
N = a[0]
A = a[1]
if N-(N//500)*500<=A:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

n %= 500

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

Submission status: Accepted

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

for i in range(a+1):
    if (n-i)%500 == 0:
        b=True
        break
if b:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

n %= 500

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

Submission status: Accepted

Solution code:



def main():

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

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

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

Submission status: Accepted

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

ans = A % 500

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

Submission status: Accepted

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

rem = N%500

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = int(input().rstrip('\n'))
    n %= 500
    print("Yes" if n <= a else "No")


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
import math

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

    m = math.floor(n/500)
    m = n - 500*m

    print('Yes' if m <= a else 'No')

aa088()

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

while X>=500:
  X=X-500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(map(int,input().split()))
t=list(map(int,input().split()))
a=int(s[0])
b=int(t[0])
c=a%500
if c<=b:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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