Problem:


Score: 100 points

Problem Statement

E869120 has A 1-yen coins and infinitely many 500-yen coins.

Determine if he can pay exactly N yen using only these coins.

Constraints

N is an integer between 1 and 10000 (inclusive).

A is an integer between 0 and 1000 (inclusive).

Input

Input is given from Standard Input in the following format:

N
A

Output

If E869120 can pay exactly N yen using only his 1-yen and 500-yen coins, print Yes; otherwise, print No.

Sample Input 1

2018
218

Sample Output 1

Yes

We can pay 2018 yen with four 500-yen coins and 18 1-yen coins, so the answer is Yes.

Sample Input 2

2763
0

Sample Output 2

No

When we have no 1-yen coins, we can only pay a multiple of 500 yen using only 500-yen coins. Since 2763 is not a multiple of 500, we cannot pay this amount.

Sample Input 3

37
514

Sample Output 3

Yes



Sample input:
2018
218


Sample output:
Yes

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(v) for v in input().split()]
A.sort()

Alice = 0
Bob = 0
for i, v in enumerate(A[::-1]):
  if i % 2 == 0:
    Alice += v
  else:
    Bob += v
print(Alice - Bob)

Submission status: Wrong Answer

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

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


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

Submission status: Wrong Answer

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

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


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

Submission status: Wrong Answer

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

while a >= 500:
    a -= 500

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
y = int(input())
for i in range(y+1):
  if x - (int(x/500)*500 + i) == 0:
    print('Yes')
    break
  if i == y+1:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
if (n - a * 1) % 500 == 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

if N % 500 <= A:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
import numpy as np

n = int(input())
a = int(input())
flag = False

for i in range(1,a+1):
    if (n-i)%500 == 0:
        flag = True
        break

if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

res = N%500
if A>=res:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

res = N%500
if A>=N:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

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

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


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


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

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n, a = IR(2)
    n %= 500
    if a > n:
        print("Yes")
    else:
        print("No")
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()

Submission status: Wrong Answer

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

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

# print(N)
# print(A)

# print(N % 500 < A)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
print(sum(a[::2])-sum(a[1::2]))

Submission status: Wrong Answer

Solution code:
row = [input().split() for i in range(2)]
n = int(row[0][0])
a = int(row[1][0])
surplus = n % 500
if surplus <= a:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())    #金額
a = int(input())    #硬貨枚数

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

Submission status: Wrong Answer

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

if (n % 500) < a:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = int(input())
if N%500 > A:
  print("NO")
else:
  print("YES")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = int(input())
if N % 500 > A:
  print("NO")
else:
  print("YES")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#coding: utf-8
n = int(input())
a = int(input())
rest = n % 500
print(rest)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# !/usr/bin python3
# -*- coding: utf-8 -*-

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

remainder = n % 500

if remainder <= a and a > 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

remainder = n % 500

if remainder <= a and a > 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

remainder = n % 500

if remainder <= a and a > 0:
    print(True)
else:
    print(False)

Submission status: Wrong Answer

Solution code:
import sys

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

if __name__ == "__main__":
    n = int(input())
    a = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
Nyen = int(input())
Amai = int(input())

while Nyen > 500:
    Nyen = Nyen - 500
if Nyen < Amai:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
Nyen = int(input())
Amai = int(input())

while Nyen > 500:
    Nyen = Nyen - 500
if Nyen < Amai:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if N % 500 <= A:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
a, b =[int(input()) for i in range(2)]
c = a//500
if c <= b:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a, b =[int(input()) for i in range(2)]
c = a//500
if c <= b:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a % 500 <= b:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if a % 500 < b:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

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

print(['No', 'Yes'][(b % 500) <= a])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if (N%500) <= A:
    print ("YES")
else:
    print ("NO")

Submission status: Wrong Answer

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

if N % 500 <= A:
        print("YES")
else:
        print("NO")

Submission status: Wrong Answer

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

if N%500 <= A:
        print("YES")
else:
        print("NO")

Submission status: Wrong Answer

Solution code:
# 2019/06/02
# AtCoder Beginner Contest 088 - A 

# Input
n = int(input())
a = int(input())

w_coin = n % 500

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

Submission status: Wrong Answer

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

amari = n % 500

if(amari < a):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if shiharai % 500 - one < 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

x=n%500

if a>x:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


class UnionFind:

    def __init__(self, n):
        self.parent = [i for i in range(n)]

    def root(self, i):
        if self.parent[i] == i:
            return i
        self.parent[i] = self.root(self.parent[i])
        return self.parent[i]

    def unite(self, i, j):
        rooti = self.root(i)
        rootj = self.root(j)
        if rooti == rootj:
            return
        if rooti < rootj:
            self.parent[rootj] = rooti
        else:
            self.parent[rooti] = rootj

    def same(self, i, j):
        return self.root(i) == self.root(j)


###############################################################################


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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n= input()
s = list(map(int , input().split()))
s =sorted(s , reverse = True)
a=sum(s[::2]) - sum(s[1::2])
print(a)

Submission status: Wrong Answer

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

for i in range(A):
  if N % 500 == i:
    print("Yes")
    exit()
print("No")

Submission status: Wrong Answer

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

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

print("No")

Submission status: Wrong Answer

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

for i in range(A):
  if (N - i) % 500:
    print("Yes")
    exit()

print("No")

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
n=0
A=0
B=0
for i in range(len(a)):
    j=max(a)
    if n%2==0:
        A+=j
        a.remove(j)
        n+=1
    else:
        B+=j
        a.remove(j)
        n+=1
print(A-B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
j = False
for i in range(a):
  n -= 1
  if n % 500 == 0:
    j = True
    break

if j:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

mod = pay % 500
if(mod <= coin):
    print('yes')
else:
    print('no')

Submission status: Wrong Answer

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

mod = pay % 500
if(mod < coin):
    print('yes')
else:
    print('no')

Submission status: Wrong Answer

Solution code:
input = list(map(str,input().split()))
num = ''.join(input)

if(int(num) % 4 == 0):
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

k=N%500

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
  size = input()
  a = list(map(int, input().split()))
  a = merge_sort(a)
  
  alice_res = 0
  bob_res = 0
  
  for i in range(len(a)):
    if i%2 == 0:
      alice_res += a[i]
    else:
      bob_res += a[i]
 
  print(alice_res-bob_res)
  
 
def merge_sort(array):
  if len(array)<=1:
    return array
  
  spl_size = len(array)//2
  
  left_list = merge_sort(array[:spl_size])
  right_list = merge_sort(array[spl_size:])
  
  return merge_list(left_list, right_list)
 
 
def merge_list(left_list, right_list):
  left_index = 0
  right_index = 0
  sorted_list = []
  
  while left_index<len(left_list) and right_index<len(right_list):
    if left_list[left_index] < right_list[right_index]:
      sorted_list.append(right_list[right_index])
      right_index+=1
    else:
      sorted_list.append(left_list[left_index])
      left_index+=1
      
  if left_index == len(left_list):
    sorted_list.extend(right_list[right_index:])
  if right_index == len(right_list):
    sorted_list.extend(left_list[left_index:])
      
  return sorted_list
    
                          
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
li = sorted(map(int,input().split()),reverse=True)
ans = sum(li[::2]) - sum(li[1::2])
print(ans)

Submission status: Wrong Answer

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

n2 = n /500

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

Submission status: Wrong Answer

Solution code:

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

N_new = N%1000

if N_new<=500:
    N_new -= 500

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if N%100<=A:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

print("Yes" if x == a else "No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
list.sort(a,reverse=True)
print(sum(a[::2])-sum(a[1::2]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())
b = list(a)
c = sorted(b, reverse=True)
print(sum(c[::2]) - sum(c[1::2]))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
if (n//500)+a > 500 or (n//500)-a <0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = n // 500

one = n - c*500

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

print(c)

Submission status: Wrong Answer

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

c = n // 500

one = n - c

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

Submission status: Wrong Answer

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

m=n%500
print "Yneos"[a<m::2]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

N%500 == A

if 1000 >= A >= 0 and 10000 >= N >= 1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
b = sorted(a)[:: -1]
print(sum(b[:: 2]) - sum(b[1:: 2]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
li = input().split()
li.sort(reverse=True)
t = 0
ans = 0
for i in li:
  if t % 2 == 0:
    ans += int(i)
  else:
    ans -= int(i)
  t += 1

print(ans)

Submission status: Wrong Answer

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

flg = False
for i in range(a):
    if (n-i) % 500 == 0:
        flg = True
        break

if flg:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,A=eval('int(input()),'*2)
while True:
    if N > 500:
        N-=500
    else:
        break
print('Yes' if A>=N else 'No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

p = N % 500

if p == 0:
    print('Yes')
else:
    if p <= A:
        print('Yes')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
input()
card = [int(i) for i in input().split(" ")]
card.sort(reverse = True)

alice = [card[i] for i in range(len(card)) if i % 2 == 0]
bob = [card[i] for i in range(len(card)) if i % 2 == 1]

print(sum(alice) - sum(bob))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

a = int(input())
b = int(input())

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(input())
ans = 0
for i in range(21):
  for j in range(a + 1):
    if 500 * i + j == n:
      ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))

a.sort(reverse=True)

print(sum(a[0::2])-sum(a[1::2]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
a = [ int(n) for n in input().split()]
a.sort(reverse=True)
A = B = 0
while len(a) > 0:
	A += a.pop(0)
	if len(a) < 1:
		break
	else:
		B += a.pop(0)
print(str(A-B))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(int(input()) % 500 <= int(input()))