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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if b-a%500>=0:
  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())
import sys
for i in range (0,1000):
    for j in range(A+1):
        if N==500*i+j:
            print ('Yes')
            sys.exit()

print ('No')

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    remnant = N % 500
    ans = "Yes" if A >= remnant else "No"
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

nn = n % 500

if a >= nn :
  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 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:
N = int(input())

A = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

A = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N = int(input())
    A = int(input())

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

Submission status: Accepted

Solution code:
# coding: utf-8
input_N = int(input())
input_A = int(input())

surplus_500 = input_N % 500
if surplus_500 <=  input_A:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"


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

    return N % 500 <= A


def main():
    print(Yes if solve() else No)


if __name__ == '__main__':
    main()

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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()) #N円
a = int(input()) #一円玉a枚

cal = n % 500 

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

Submission status: Accepted

Solution code:
N=int(input())
A=int(input())
a=int(N/500)
if N-a*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:
#-*- coding:utf-8 -*-

if __name__ == "__main__":
    N = int(input())
    A = int(input())
    # 500円玉無限枚なので、Nを500で割った余りが1円玉で払えるかを考える
    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())
                                                                                                                           
print('Yes' if n % 500 <= a else 'No')

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

n = int(arr_data[0][0])

#1円効果の数
a = int(arr_data[1][0])


cnt =n //500

#print(cnt)

print("Yes" if n-cnt*500<=a else "No")

Submission status: Accepted

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

need_coin = n % 500

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
amari = n % 500
if amari <= a :
    print('Yes')
if amari > a :
    print('No')
#aとbが同じなら a == b

Submission status: Accepted

Solution code:
n = int(input(""))
a = int(input(""))
flag = 0

for i in range(a+1):
    if (n-i)%500 == 0:
        print("Yes")
        flag = 1
        break
if flag == 0:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
 
a = []
for i in range(2):
    a.append(int(input()))
tmp = math.floor(a[0]/500)
tmp1 = a[0] - tmp*500
if a[1] >= tmp1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

quotient, remainder = divmod(N, 500)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

N = input(); A= input()
A,N = int(A), int(N)

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:
if __name__ == '__main__':
    n = int(input())
    a = int(input())

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

Submission status: Accepted

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

for i in range(0,N / 500):
	N = N - 500
if(N <= A):
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
a = []
for i in range(1):
    a.append(int(input()))

if N % 500 ==0:
    print('Yes')
else:
    calc = N % 500
    if a[0] >= calc:
        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:
a=input()
b=input()

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

Submission status: Accepted

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

Submission status: Accepted

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

b=num%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:
#-*- coding: utf-8 -*-
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())%500
a = int(input())
if n>a:
    print('No')
else:
    print('Yes')

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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())
R = N % 500
if A >= R:
    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())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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 - N // 500 * 500 - A <= 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if int(n)%500<=int(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:
# coding: utf-8
N = int(input())
A = int(input())

c = N%500

if c > 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:
# coding: utf-8
# Your code here!
N = int(input())
A = int(input())
surplus = N % 500
if A >= surplus:
    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 = input()
A = input()

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

rest = N % 500

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

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
x = n // 500        # 支払うべき500円硬貨の枚数
y = n - 500 * x    # 500円硬貨のみで払った時の残金
if y <= a:
     print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
n = int(raw_input())
a = int(raw_input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

X = N % 500

if (X - A <= 0) :
    print('Yes')
else :
    print('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:
#ABC088A

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
def main():
    N = int(input() )
    A = int(input() )
    
    surplus = N % 500
#    print(surplus)
    if(surplus <= A):
        print("Yes")
    else:
        print("No")
    
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
#coding:utf-8

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

n = N%500

ans = ""

if n <= A:
    ans += "Yes"
    print(ans)
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())

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

Submission status: Accepted

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

c = a % 500

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

Submission status: Accepted

Solution code:
# -*- coding:utf8 -*-
## Nは支払額, Aは1円の枚数
def t1(N, A):
    # 制約
    ## Nは1以上の10000以下の整数
    ## Aは0以上の1000以下の整数

    ### Nが整数かどうか判定
    if not (isinstance(N, int)):
        return ("No")
    ### Nは1以上の10000以下かチェック
    if not (1 <= N <= 10000):
        return ("No")

    ### Aが整数かどうか判定
    if not (isinstance(A, int)):
        return ("No")

    ### Aは0以上の1000以下かチェック
    if not (0 <= A <= 1000):
        return ("No")

    amari = N % 500

    if not amari:
        return ("Yes")

    if A >= amari:
        return ("Yes")
    else:
        return ("No")

loop_count = 0
input_list = []
while loop_count < 2:
    n = input()
    input_list.append(n)
    loop_count += 1
goukei = input_list[0]
ichien = input_list[1]
print (t1(goukei, ichien))

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
if __name__ == "__main__":
    n = int(input())
    a = int(input())
    n -= 500*(n//500)
    if n <= a:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

mod = N % 500

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

Submission status: Accepted

Solution code:
def main():
    N = int(input().strip()) # N円
    A = int(input().strip()) # A枚

    zan = N
    if N > 500:
        zan = N % 500
    if zan > A:
        return "No"
    return "Yes"
if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
def main():
    global A
    N = int(input())
    A = int(input())

    if N > 500:
        calc(N%500)
    
    elif N < 500:
        calc(N)

    else:
        print('Yes')

def calc(yen):
    if yen > A:
        print('No')
    else:
        print('Yes')




if __name__ == '__main__':
    main()

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())
for i in range(a+1):
    v=n-i
    if v%500==0:
        print("Yes")
        exit()
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    n = int(raw_input())
    a = int(raw_input())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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('No')
else:
 print('Yes')

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
N %= 500
print("Yes" if A >= N else "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())
for i in range(N//500+1):
    if N-500*i >=0 and N-500*i <= A:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print (lambda x,y: "Yes" if x % 500 <= y else "No")(input(), input())

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

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

Submission status: Accepted

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

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

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

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:
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: Accepted

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

input_lines=input()
price=int(input_lines)

input_lines=input()
coins=int(input_lines)

frac=price%500

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

Submission status: Accepted

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

rest = N % 500

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    a = I()
    if n%500 <= a:
        return 'Yes'

    return 'No'


print(main())

Submission status: Accepted

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

if A >= N:
    print("Yes")
else:
    n = N % 500
    if n == 0 or (n != 0 and 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:
# -*- coding: utf-8 -*-
N = int(raw_input())
A = int(raw_input())
if N%500 <= A:
    print "Yes"
else:
    print "No"

Submission status: Accepted

Solution code:
import sys
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    input_raw = read_func().strip().split()
    [A] = [int(input_raw[0])]

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N= int(input()[-3:])
A= int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

itien = N%500

if itien > A:
   print("No")
else:
   print("Yes")

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

def solve():
    n5 = n // 500
    n1 = n - 500*n5
    if n1 > a:
        print("No")
    else:
        print("Yes")
solve()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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