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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = input()
s = int(input())
n1 = int(n[-2] + n[-1])
if n1 <= s:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

num = int(N / 500)
rest = N - num

if A != 0 and rest <= A:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

num = int(N / 500)
rest = N - num

if A != 0 and rest <= N:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def solver(total, haveOneYen):

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


if __name__ == "__main__":

    answer = ""
    N = int(input())
    A = int(input())
    answer = solver(N, A)
    if answer:
        print(yes)
    else:
        print(no)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
new_list_reverse = sorted(l, reverse=True)

a = sum(new_list_reverse[0::2])
b = sum(new_list_reverse[1::2])

print(a-b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input()) # 支払い金学
A = int(input()) # 1円の枚数
range_A = range(1,A)
flag = False
for a in range_A:
  if (N - a + 1) % 500 == 0:
    flag = True
    break

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

Submission status: Wrong Answer

Solution code:
N = int(input()) # 支払い金学
A = int(input()) # 1円の枚数
range_A = range(A)
flag = False
for a in range_A:
  if (N - a) % 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 a>n%500:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, a = open(0).read().split()
print('Yneos'[int(n)%500>int(a)::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = int(input())
for a in range(A + 1):
    if (N - a) % 500 == 0:
        print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=int(input())
if(a==0):
  print("YES")
elif((a%500)>n):
  print("NO")
else:
  print("YES")

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 2018 % 500 <= 218:
    print('YES')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = int(input())
#print(N, 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:
  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())

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

Submission status: Wrong Answer

Solution code:
import sys

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

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

main()

Submission status: 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 and a>=n:
  print("Yes")
elif n>=500 and n%500<a:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = int(input())
C500 = int(N/500)
if(A > N - C500*500):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

N = int(input())

a_list = list(map(int, input().split()))
a_list.sort(reverse = True)

count = 0
allice_total = 0
bob_total = 0
for a in a_list:
    if count % 2 == 0:
        allice_total += a
    else:
        bob_total += a
    count += 1

print(allice_total - bob_total)

Submission status: Wrong Answer

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

for i in range(201):
    for j in range(a):
        if(i * 500 + j == n):
            print("Yes")
            quit()

print("No")

Submission status: Wrong Answer

Solution code:
N=int(input())
a=int(input())
def coin():
    for i in range(1,25):
        if N-500*i<=a and N-500*i>=0:
            print("Yes")
            break
        if N==a or N<=a:
            print("Yes")
            break
        else:
            print("No")
            break
coin()

Submission status: Wrong Answer

Solution code:
N=int(input())
a=int(input())
if N%500==0:
    print("Yes")
elif N<=a:
    print("Yes")
elif N>a:
    for i in range(1,24):
        if N-(500*i)<=a and N-(500*i)>=0:
            print("Yes")
            break
        else:
            print("No")
            break
elif a==0 and N%500!=0:
    print("No")

Submission status: Wrong Answer

Solution code:
N=int(input())
a=int(input())
if N%500==0:
    print("Yes")
elif N<=a:
    print("Yes")
elif N>a:
    for i in range(1,24):
        if N-(500*i)<=a and N-(500*i)>=0:
            print("Yes")
            break
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N=int(input())
a=int(input())
if N%500==0:
    print("YES")
elif N<=a:
    print("YES")
elif N>a:
    for i in range(1,24):
        if N-(500*i)<=a and N-(500*i)>=0:
            print("Yes")
            break
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N=int(input())
a=int(input())
if N%500==0:
    print("YES")
elif N<=a:
    print("YES")
elif N>a:
    for i in range(1,24):
        if N-(500*i)<=a and N-(500*i)>=0:
            print("YES")
            break
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
N=int(input())
a=int(input())
if N%500==0:
    print("YES")
elif N<=a:
    print("YES")
elif N>a:
    for i in range(1,24):
        if N-(500*i)<=a and N-(500*i)>=0:
            print("YES")
            break
        else:
            print("NO")
            break
elif a==0 and N%500!=0:
    print("NO")

Submission status: Wrong Answer

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

while A > 500:
  A = A - 500

if A <= B:
  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) % 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())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n %= 500

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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



def main():

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

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



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc088/tasks/abc088_b
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(a[::2]) - sum(a[1::2]))

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    a = int(input())
    n = n // 500
    if n <= a:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    main()

Submission status: 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 = input()
a = list(map(int, input().split()))
a= sorted(a, reverse=True)
ans =0
for i in a:
    if i%2 == 0:
        ans += i
    elif i%2 ==1:
        ans -= i
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

li =list(input().strip() for i in range(2))
n = int(li[0]) % 500

if int(li[1]) >= n:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

li_list = [input().strip() for i in range(2)]
n = int(li_list[0]) % 500

if int(li_list[1]) >= n:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

li = [input().strip() for i in range(2)]
n = int(li[0]) % 500

if int(li[1]) >= n:
    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 sys
input = sys.stdin.readline

N = int(input()) % 500
A = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

n = int(input()) % 500
a = int(input())

if a >= n:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

r = 2
li = [input().strip() for i in range(r)]

n = int(li[0]) % 500
#print(n)
'''
if n == 0:
    print('YES')
else:
    '''
if int(li[1]) >= n:
    print('YES/n')
else:
    print('NO/n')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

r = 2
li = [input().strip() for i in range(r)]

n = int(li[0]) % 500
#print(n)
'''
if n == 0:
    print('YES')
else:
    '''
if int(li[1]) >= n:
    print('YES¥n')
else:
    print('NO¥n')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

r = 2
li = [input().strip() for i in range(r)]

n = int(li[0]) % 500
#print(n)

if n == 0:
    print('YES')
else:
    if int(li[1]) >= n:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

r = 2
li = [input().strip() for i in range(r)]

n = int(li[0]) % 500
#print(n)

if n == 0:
    print('YES')
else:
    if int(li[1]) >= n:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

r = 2
li = [input().strip() for i in range(r)]

n = int(li[0]) % 500

if int(li[1]) >= n:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

while n > 500:
    n -= 500

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

ans = "No"
for a in range(A):
    N -= 1
    if N%500 == 0:
        ans = "Yes"
print(ans)

Submission status: Wrong Answer

Solution code:
# ABC088 A - Infinite Coins
n = int(input())
a = int(input())

for i in range(a):
    for j in range(21):
        if i + 500*j == n:
            print('Yes')
            exit()
print('No')

Submission status: Wrong Answer

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

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:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

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

nmod=N%500

if nmod<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 = int(input())
r = "YES" if n % 500 <= a else "NO"
print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=int(input())
for i in range(a+1):
    if n%500==0:
        break
    else:
        n-=1
print('Yes' if n%500==0 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, a = [int(input()) for _ in range(2)]
print('Yes' if n % 50 <= a else 'No')

Submission status: Wrong Answer

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

if 2*(N-A)%1000==0 and N-A>0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if 2*(N-A)%1000==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())

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

tmp = N // 500
for a in range(1, A+1):
    total = a*1 + tmp*500
    if total == N:
        print('YES')
        exit()
print('NO')

Submission status: Wrong Answer

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

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

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:
import math
N=int(input())
A=int(input())
ans = 0
for i in range(math.ceil(N/500)):
    ans += int(A>=(N-500*i))
if ans > 0:
    print("Yes")
else: print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l=[int(input()) for i in range(2)]
N=l[0]
A=l[1]
r=N%500
if r > A:
	print('NO')
else:
	print('YES')

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, A = [int(input()) for _ in range(2)]

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = map(int, input().split(' '))

a=sorted(a, reverse=True)

alice =0
bob   =0

count=0

for i in a:
    if count%2 == 0 :
       alice += i  
    else:
       bob += i
    count+=1

print(alice - bob)

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:
# -*- coding: utf-8 -*-

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

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

Submission status: Wrong Answer

Solution code:
n = list(map(int , input().split()))
B = list(map(int , input().split()))
amari =  n[0]%500
if amari - B[0]  <= 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:
# -*- coding: utf-8 -*-

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

print("YES" if (n % 500) <= a else "NO")

Submission status: Wrong Answer

Solution code:
#coding:UTF-8

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

left_N = N % 500
if N % 500 == 0:
  #まず500円だけの簡単バージョン
  print("yes")
elif left_N < 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())
coinsize = int(input())
yes = False
for i in range(coinsize):
#    print("aaa")
    if((N - 1*i) % 500 is 0):
        print("Yes")
        yes = True
        break
if yes is False:
    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:
pay = input()
oney = input()

print('YES' if (int(pay) % 500) <= int(oney) else 'NO' )

Submission status: Wrong Answer

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

#1円玉で支払う金額
need = n % 500

if a >= need or need == 0:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

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

#1円玉で支払う金額
need = n % 500

if a >= need:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

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

#1円玉で支払う金額
need = n % 500

if a <= need:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
n, a = [int(input()) for _ in range(2)]
print('Yes' if n >= a%500 else 'No')

Submission status: Wrong Answer

Solution code:
card_count = int(input())
cards = input()
cards = [int(value) for value in cards.split(' ')]
cards = sorted(cards, reverse=True)

alice = 0
bob = 0

for i in range(0, len(cards) - 1, 2):
    alice += cards[i]
    bob += cards[i + 1]

print(alice - bob)

Submission status: Wrong Answer

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

print("Yes" if N==(((N//500)*500) + (N%500)*A) else "No")

Submission status: Wrong Answer

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

print(((N//500)*500) + (N%500))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = int(input())
num = 0
while N - 500*num > 0:
  num += 1
num1 = N - 500 * (num-1)
if num1 <= A:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
N,A = [int(input()) for i in range(2)]
num = 0
while N - 500*num > 0:
  num += 1
num1 = N - 500 * (num-1)
if num1 <= A:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n = [input() for i in range(2)]
num = 0
while int(n[0]) - 500*num > 0:
  num = num + 1
num1 = int(n[0]) - 500 * (num-1)
if num1 <= int(n[1]):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
N = input()
A = input()
num = 0
while int(N) - 500*num > 0:
  num = num + 1
num1 = int(N) - 500 * (num-1)
if num1 <= int(A):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input()) #支払う金額　　　　
a = int(input()) #1円玉の枚数
b = n // 500 #必要な500円玉の枚数

if n - (500 * b) - 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())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

A %= 500

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#88

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


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

i=0
while N>500:
    N = N-500
    
if N<=A:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input()) #price
A = int(input()) #number of coins

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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