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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p = int(input())
c1 = int(input())

change = p % 500

if (change == 0) or (c1 > change):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

n %= 500

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

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:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
#from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
#from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [LI()for i in range(n)]
inf = 10**17
mod = 10**9 + 7

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N=int(input())
    A=int(input())
    YesNo(N%500<=A)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

while True:
    if n >= 500:
        n -= 500
    
    else:
        break

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

B = N//500
C = N - 500*B

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

remainder = n % 500

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

Submission status: Accepted

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

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 <= 0 else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

def resolve():
    N = int(input())
    A = int(input())

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
1 <= N <= 10000
0 <= A <= 1000
if N < 500 and N == A:
    print("Yes")
elif A >= N%500:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))

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

if __name__ == '__main__':
    main()

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

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

Submission status: Accepted

Solution code:
#--Infinite Coins
cost = int(input())
one_coins = int(input())

for i in range(one_coins+1):
  calculate = cost - i
  if (calculate % 500 == 0):
    print ("Yes")
    exit()
  else:
    pass

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

Submission status: Accepted

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

Submission status: Accepted

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


if '__main__' == __name__:
    resolve()

Submission status: Accepted

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


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


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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
price = int(input())
num1 = int(input())

amari = price % 500

if amari <= num1:
    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:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


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

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

Submission status: Accepted

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

n = n - (n // 500) * 500

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

ans = n % 500
if ans <= 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:
pay = int(input())
have = int(input())

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

ans = 0


while ans<=(N-500):
    ans += 500

if (ans+A)>=N:
    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:
a= int(input())
b= int(input())

result = a%500

if result - b <= 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import math

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

n=n-math.floor(n/500)*500
if n<=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())
n = n%500
if n <= a:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print('YNeos'[int(input())%500-int(input())>0::2])

Submission status: Accepted

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


result = a % 500

if result - b <= 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
url = "https://atcoder.jp/contests/abc088/tasks/abc088_a"

def main():
    n = int(input())
    m = int(input())

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
print("YNeos"[int(input())%500>int(input())::2])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
A=int(input())
x=N//500

if N-x*500<=A:
    print("Yes")
else:print("No")

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
A = int(input())

B = N // 500
if N - B * 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())
left = n % 500
if left > 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 calc():

    amari = N % 500

    if amari <= A:
        return"Yes"

    else:
        return"No"

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

print(calc())

Submission status: Accepted

Solution code:
import sys

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

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

if __name__ ==  '__main__':
    main()

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:
# ABC 088: A – Infinite Coins
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:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
a = ii()

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

Submission status: Accepted

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

if N % 500 == 0 :
	answer = "Yes"
elif N % 500   <= A:
	answer = "Yes"
else:
	answer = "No"

print(answer)

Submission status: Accepted

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = a %500

    if c <= b:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
n=int(input())
a=int(input())
x=n-(n//500)*500
if x>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())
amari = N % 500
if A >= amari:
    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:
import sys
from math import sqrt
from collections import Counter

input = sys.stdin.readline


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(MI())


inf = float("inf")
mod = 10 ** 9 + 7


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

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

    pass


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
d=input;print('YNeos'[int(d())%500>int(d())::2])

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

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:
N=int(input())
A=int(input())
flag=True
ans="No"

for i in range(0,A+1):
  if flag:
    for j in range(0,N//500+1):
      if i+500*j==N:
        ans="Yes"
        flag=False
        break

print(ans)

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

Submission status: Accepted

Solution code:
# | Its_Rashid | #
a = int(input())
b = int(input())
print('Yes' if a // 500 * 500 + b >= a else 'No')

Submission status: Accepted

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

amari=int(n%500)

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

else:
    print('No')

Submission status: Accepted

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

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

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


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, A = [int(sys.stdin.buffer.readline().rstrip()) for _ in range(2)]
    print('Yes' if N%500 <= A else 'No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

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

main()

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
N,A = [int(input().rstrip()) for i in range(2)]
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:
    n=n%500

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

Submission status: Accepted

Solution code:
import sys

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

amari = n % 500

print("Yes") if amari <= a 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())

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:
  ans = 'Yes'
else:
  ans = 'No'
print(ans)
#print(*ans, sep='\n')

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:
cost = int(input())
itien = int(input())
if itien >= cost % 500:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

rmn = N % 500

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

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
nd5 = n//500
f = False
if nd5*500+a >= n:
    f = True
print("Yes") if f 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())
coin = n%500
if a >= coin:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

n = n % 500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 10 05:50:12 2020

@author: baddude
"""


ttl = int(input())
no_1yen = int(input())

remain = ttl % 500
if no_1yen >= remain:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

n=n%500

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

Submission status: Accepted

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

Submission status: Accepted

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

if A >= N%500 :
  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
n = int(sys.stdin.readline())
a = int(sys.stdin.readline())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 支払うべき金額
N = int(input())
# 持っている1円硬貨の枚数
A = int(input())
# 1円玉で払うべき金額
mod = N % 500
#支払い可不可判定
if mod <= A:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())

n_rem = n % 500

a = int(input())

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

Submission status: Accepted

Solution code:
from sys import stdin

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

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

Submission status: Accepted

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