Problem:


Score : 200 points

Problem Statement

Raccoon is fighting with a monster.

The health of the monster is H.

Raccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.
There is no other way to decrease the monster's health.

Raccoon wins when the monster's health becomes 0 or below.

If Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.

Constraints

1 \leq H \leq 10^9

1 \leq N \leq 10^5

1 \leq A_i \leq 10^4

All values in input are integers.

Input

Input is given from Standard Input in the following format:

H N
A_1 A_2 ... A_N

Output

If Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.

Sample Input 1

10 3
4 5 6

Sample Output 1

Yes

The monster's health will become 0 or below after, for example, using the second and third moves.

Sample Input 2

20 3
4 5 6

Sample Output 2

No

Sample Input 3

210 5
31 41 59 26 53

Sample Output 3

Yes

Sample Input 4

211 5
31 41 59 26 53

Sample Output 4

No



Sample input:
10 3
4 5 6


Sample output:
Yes

Submission status: Accepted

Solution code:
def main():
    H, N = [int(_) for _ in input().split()]
    A = []
    A = [int(_) for _ in input().split()]
    if H <= sum(A):
        print("Yes")
    else:
        print("No")
main()

Submission status: Accepted

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

A = list(A)
A.sort(reverse=True)
atk = sum(A[:N])
if atk >= H:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X = list(map(int, input().split()))
Y = list(map(int, input().split()))

H = X[0]
N = X[1]

A = sum(Y)

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

Submission status: Accepted

Solution code:
from bisect import bisect_right, bisect_left
from itertools import groupby, permutations, combinations
from fractions import gcd
import numpy as np
from sys import stdin, stderr


def lcm(x, y):
    return (x * y) // gcd(x, y)


def main():
    H, N = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]
    A.sort()
    for i in range(N):
        H -= A[N - i - 1]
    ret = "Yes" if H <= 0 else "No"
    return ret


if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:
h,n=map(int,input().split())
a=list(map(int,input().split()))
if h-sum(a[:n])<=0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
HN = input().split()
H = int(HN[0])
N = int(HN[1])

sum = 0

A = input().split()
for i in range(N):
  sum += int(A[i])

  
if(sum >= H):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
H_N=input().split()
H=int(H_N[0])
N=int(H_N[1])
Alis=list(map(int,input().split()))

if sum(Alis)>=H:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
H,N = map(int,input().split())
A = list(map(int,input().split()))

for i in range(N):
    H -= A[i]

if H > 0 :
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
h, n = map(int, input().split())
a = list(map(int, input().split()))
sum = 0
for i in a:
    sum += i
if sum >= h:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

H,N = map(int,input().split())
A = list(map(int,input().split()))

#print(H)
##print(N)
#print(A)

SUM = 0
for i in range(N):
    SUM += A[i]

if H<=SUM:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a=input()
H,N=int(a.split()[0]),int(a.split()[1])
b=input().split()
list=list(map(int, b))
if(sum(list)>=H):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import numpy as np
N, M = map(int, input().split())
count=0
flag=True

A = list(map(int, input().split()))



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

Submission status: Accepted

Solution code:
import math
n,m=list(map(int,input().split()))
a=list(map(int,input().split()))
if sum(a)>=n:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
H,N = map(float,input().split())
A = list(map(float,input().split()))

su = float(sum(A))


if su >= H:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

skills = sorted(skills_list, reverse=True)

judge = 0

for i in range(a):
  judge = judge + skills[i]

if judge >= h:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
h, n = map(int, input().split())
A =[int(i) for i in input().split()]

if h > sum(A):
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
h, n = map(int, input().split())
a = list(map(int, input().split()))
if h <= sum(a) :
  print("Yes")
else :
  print("No")

Submission status: Accepted

Solution code:
H, N = map(int, input().split())
l = map(int, input().split())

if (sum(l)>=H):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
H,N = map(int,input().split())
A = list(map(int,input().split()))

S = sum(A)

if S >= H:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
H, N = map(int, input().split())
A = [int(i) for i in input().split()]

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

Submission status: Accepted

Solution code:
h,n=map(int,input().split())
A=list(map(int,input().split()))
if sum(A)>=h:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
h, n = map(int, input().split())
a = [int(i) for i in input().split()]
if sum(a) >= h:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
H,N=map(int,input().split())
A=list(map(int,input().split()))
num=0
for i in range(N):
  num=num+A[i]
if num>=H:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
h,n = map(int,input().split())
a = list(map(int,input().split()))
s = sum(a)
if s < h:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
h,n=map(int,input().split())
a=[int(i) for i in input().split()]
print("Yes" if sum(a)>=h else "No")

Submission status: Accepted

Solution code:
[H, N] = [int(x) for x in input().split()]
A = list(map(int, input().split()))
count = 0
for x in A:
    count += x
print("Yes" if count >= H else "No")

Submission status: Accepted

Solution code:
H,N = map(int,input().split())
A = list(map(int,input().split()))
a = 0
for i in A:
        a+=i
if a>=H:
        print("Yes")
else:
        print("No")

Submission status: Accepted

Solution code:
h,n = map(int,input().split())
p = list(map(int,input().split()))
a = 0
for i in p:
  a += i
if a >= h:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
h, a = map(int, input().split())
a = list(map(int, input().split()))
if sum(a) >= h:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
h,n=map(int,input().split())
a=input().split()
a=list(map(int,a))
a.sort(reverse=True)
flag=0
ans=0
for i in range(n):
    ans+=a[i]
    if ans>=h:
        flag=1
        break
if flag==1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
H, N = [int(n) for n in input().split()]

A = [int(n) for n in input().split()]

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
H,N = map(int,input().split())
A = [int(a) for a in input().split()]
Asum = sum(A)
if Asum >= H:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
i=list(map(int,input().split()))
j=list(map(int,input().split()))
h=i[0]
a=True
c=0
j.sort(reverse=True)
for b in j:
  c+=b
  if c>=h:
    print("Yes")
    a=False
    break
if a:
  print("No")

Submission status: Accepted

Solution code:
h,n=map(int,input().split())
a=list(map(int,input().split()))
A=0
for i in range(n):
    A+=a[i]
if A>=h:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
a=input().split()
k=[]
for i in a:
    k.append(int(i))
if x-sum(k)<=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

a = list(map(int,input().split()))

A = sum(a)

if h - A > 0:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
hn = list(map(int, input().split()))
h = hn[0]
n = hn[1]
a = list(map(int, input().split()))

s = sum(a)

if s >= h:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
H,N = map(int,input().split())
A = list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
H,N = map(int,input().split())
A = list(map(int,input().split()))
tempsum=sum(A)
if H>tempsum:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys
import math

h,n = list(map(int,input().split()))
li = list(map(int,input().split()))

if (sum(li) >= h):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

list = list(map(int,list(input().split())))

if sum(list) >= H:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
# B
H, N = map(int, input().split())
A = list(map(int, input().split()))

if H>sum(A):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
def acinput():
    return list(map(int, input().split(" ")))

H,N=acinput()
A=acinput()

if H>sum(A):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
def  spe(H,A):
    att_sum = sum(A) 
    if H -att_sum>0:
        print("No")
    else:
        print("Yes")
        



inp = input().split()
inp_ = input().split()
H = int(inp[0])
N = int(inp[1] )
A= [int(i) for i in inp_]
spe(H,A)

Submission status: Accepted

Solution code:
h, _ = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
if h <= sum(a):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

a.sort(reverse=True)
#print(a)
flag = 0
damage = 0
for i in range(c[1]):
  damage += a[i]
  if damage >= c[0]:
    flag = 1
    break

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

Submission status: Accepted

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

### TESTCASE
test = ""
#test = \
"""
10 3
4 5 6
ans Yes
"""

"""
20 3
4 5 6
ans No
"""

"""
210 5
31 41 59 26 53
ansYes
"""

"""
211 5
31 41 59 26 53
ans No
"""
############
test = list(reversed(test.strip().splitlines()))
if test:
    def input2():
        return test.pop()
else:
    def input2():
        return input()
####### MAIN

h, n = map(int, input2().split())
a = list(map(int, input2().split()))

suma = sum(a)

if h > suma:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
h,n = map(int,input().split())
li = list(map(int,input().split()))
if sum(li) >= h:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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


#print(h,n)
#print(a)

a.sort(reverse=True)

#print(a)
win = 0

for i in range(n) :
    h = h - a[i]
    if h <= 0 :
        win=1
        break

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

Submission status: Accepted

Solution code:
H,N=(int(x) for x in input().split())
A=list(map(int, input().split()))
B=sum(A)
if B >= H:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
h, n = map(int, input().split())
a = [int(i) for i in input().split()]
if sum(a) >= h:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
A = list(map(int, input().split()))
B = list(map(int, input().split()))
if sum(B) >= A[0]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
h,n = map(int,input().split(" "))
a=[int(i) for i in input().split(" ")]

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

Submission status: Accepted

Solution code:
h, n = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
if h <= sum(a):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
h, n = map(int,input().split())
a_list = list(map(int,input().split()))
if sum(a_list) >= h:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# coding: utf-8

h, n = map(int, input().split())
alist = list(map(int, input().split()))
total = sum(alist)
if total >= h:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
a = input()
a = a.split(" ")
b = input()
b = b.split(" ")
c = 0
for b_num in b:
  c = c + int(b_num)
  
if int(a[0]) <= c:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
H,N = map(int,input().split())
hairetu = list(map(int,input().split()))


goukei = sum(hairetu)

if goukei>=H:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
H,A = list(map(int, input().split()))
A = list(map(int,input().split()))
S = sum(A)
if S < H:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
h, n = list(map(int, input().split()))
lst = list(map(int, input().split()))
sum = 0
for _ in range(n):
  sum += lst[_]
if sum >= h:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
# スペース区切りの整数入力
h,n = map(int, input().split())
# スペース区切りの整数をリストに入力
a = [int(x) for x in input().split()]
aa = 0
for i in a:
    aa = aa + i

if h > aa:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
H, A = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
for x in A:
    H -= x
print("Yes" if H <= 0 else "No")

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
H, N = map(int, input().split())
i = list(map(int, input().split()))
a=0

for k in range(N):
    a+=i[k]

if H>a:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
H, N = map(int, input().split())
A_list_ = input().split()
A_list = [int(s) for s in A_list_]


sorted_A_list = sorted(A_list, reverse=True)

if sum(sorted_A_list[0:N])>=H:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
H,N=map(int,input().split())
A=list(map(int,input().split()))

if H-sum(A)>0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
h,n = map(int,input().split())
a = sorted(list(map(int,input().split())),reverse=True)
ans = 0
summ = 0
for i in range(len(a)):
    summ += a[i]
    if summ >= h:
        ans = 1
        break
if ans == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import numpy as np
H, N = map(int, input().split())
As = [int(x) for x in input().split()]
if H - np.sum(As) <= 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import math

H, N = map(int, input().split(' '))
A = list(map(int, input().split(' ')))


def main():
    if sum(A) < H:
        return 'No'
    else:
        return 'Yes'


ans = main()

print(ans)

Submission status: Accepted

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

b.sort(reverse=True)

i = 0

while n > 0:
    hp = hp - b[i]
    i += 1
    n -= 1

if hp < 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
H, N = map(int, input().split())
A = list(map(int, input().split()))

sum_a = 0
for i in range(N):
    sum_a += A[i]

if H <= sum_a:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
H,N=map(int,input().split())
A=map(int,input().split())

if sum(A)<H:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
input1 = input().split()
HP = int(input1[0])

input2 = input().split()
ATK = sum(list(map(int,input2)))

if HP <= ATK:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
H,N=map(int,input().split())
A=list(map(int,input().split()))
if H<=sum(A) : print("Yes")
else : print("No")

Submission status: Accepted

Solution code:
h,n=map(int,input().split())
l=list(map(int,input().split()))
a=sum(l)
if a<h:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
h, n = map(int, input().split())
n_list = [int(i) for i in input().split()] 
n_list.sort()

for dmg in n_list:
    h = h - dmg
    if h <= 0:
        print ("Yes")
        exit (0)

print ("No")

Submission status: Accepted

Solution code:
h, n = map(int, input().split( ))
if h <= sum(list(map(int, input().split( )))):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
h, n = map(int, input().split())
a = list(map(int, input().split()))
for x in a:
  h -= x
if h > 0:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
H, A = list(map(int, input().split()))
A = sum(list(map(int, input().split())))
if H<=A:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
H,N=map(int, input().split()) 
A=list(map(int, input().split())) 

if sum(A) < H:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
# coding: utf-8
def main():
    H, N = map(int, input().split())
    A = input().split()
    A = [int(i) for i in A]

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

s=sum(a)

if s >= h:
  print("Yes")
  
else:
  print("No")

Submission status: Accepted

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

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


def solve(H: int, N: int, A: "List[int]"):
    sum_a = sum(A)
    if sum_a < H:
        print(NO)
    else:
        print(YES)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(H, N, A)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#h,n
h,n=(int(x) for x in input().split())

#a(n)
a=input().split()

#ブレイクした方が良いかな…
for i in a:
    h -= int(i)

if (h<=0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt
from fractions import gcd
from itertools import permutations, combinations

def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas



H, N = mulinputs()
As = list(mulinputs())

As.sort(reverse=True)

flg = False
sum = 0
for a in As:
    sum += a
    if H - sum <= 0:
        flg = True
        break

# 出力
if flg:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

h, n = map(int, input().split())
a = [int(i) for i in input().split()]

d = 0
for i in a:
    d += i

if h > d:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
H, N = map(int, input().split())           
A = [i for i in map(int, input().split())] 
                                           
print('Yes' if sum(A) >= H else 'No')

Submission status: Accepted

Solution code:
H,N=map(int,input().split())
ar= list(map(int, input().split()))
sumd=0
for i in range(N):
    sumd+=ar[i]

if sumd >= H:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
H, N = map(int, input().split())
if sum(map(int, input().split())) >= H:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
H, A = map(int, input().strip().split())
Alist = map(int, input().strip().split())
sumA = sum(Alist)
if sumA >= H:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
h, at = input().split(' ')
h = int(h)
at = int(at)

hissatsu_l = [int(a) for a in input().split(' ')]

print(
	'Yes' if sum(hissatsu_l)>=h else 'No'
)

Submission status: Accepted

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

if sum(p)>=h:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
H,N = map(int, input().split())
A = list(map(int, input().split()))
sum=0
for i in range(N):
  sum += A[i]

if sum >= H:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
h,n = map(int, input().split(" "))
a = [ int(x) for x in input().split(" ")]

if h > sum(a):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

S = sum(a)

if h <= S:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
h, n, *a = map(int, open(0).read().split())

sum = 0
for a_i in a:
  sum += a_i
  
if sum >= h:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
''' Hey stalker :) '''
INF = 10**10
def main():
    print = out.append
    ''' Cook your dish here! '''
    h, n = get_list()
    li = get_list()
    if sum(li)>=h:
        print("Yes")
    else: print("No")
 
 
 
''' Pythonista fLite 1.1 '''
import sys
#from collections import defaultdict, Counter
#from bisect import bisect_left, bisect_right
#from functools import reduce
#import math
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()
#[main() for _ in range(int(input()))]
print(*out, sep='\n')

Submission status: Accepted

Solution code:
h,n=map(int,input().split())
A=list(map(int,input().split()))
print('No' if sum(A)<h else 'Yes')

Submission status: Accepted

Solution code:
H, N = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
#print(A)

for i in range(N):
  H -= A[i]

if H <= 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
H,N = list(map(int, input().split()))
A = list(map(int, input().split()))

total = sum(A)

if(total >= H):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
H,N=map(int,input().split())
A=list(map(int,input().split()))

for i in range(len(A)+1):
    if H-sum(A,i)<=0:
        print("Yes")
        break
    else:
        print("No")
        break

Submission status: Accepted

Solution code:
H = list(map(int, input().split()))
A = list(map(int, input().split()))

attack = 0
for i in range(H[1]):
    attack += A[i]

if (H[0] - attack) > 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
H,N = list(map(int, input().split())) 
A = list(map(int, input().split())) 
if H > sum(A):
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
h,n = map(int,input().split())
s = list(map(int,input().split()))
res = h - sum(s)
if res <= 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
dummy = list(map(int, input().split(" ")))
H = dummy[0]
N = dummy[1]

A = list(map(int, input().split(" ")))


if(sum(A) >= H):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
H , A = map(int, input().split())
li = list(map(int,input().split()))

if H > sum(li):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
H, N=(int(i) for i in input().split())
A=[int(i) for i in input().split()]
if sum(A)>=H:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
h, n = map(int, input().split())
asum = sum(map(int, input().split()))
print('Yes' if asum >= h else 'No')

Submission status: Accepted

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

ans = h - sum(lis)

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

Submission status: Accepted

Solution code:
h,n=map(int,input().split())
ai=[]
asum=0
for i in map(int,input().split()):
    asum=asum+i
if asum<h:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
array = list(map(int, input().strip().split()))
total = sum(array)
out = "Yes" if a <= total else "No"
print(out)

Submission status: Accepted

Solution code:
import math as m
h,n = map(int,input().split())
a = list(map(int,input().split()))
res = sum(a)

if res>=h:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
H,N = map(int,input().split())
a = [int(s) for s in input().split()]
s = H - sum(a)
if s <= 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
h, n = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]

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

Submission status: Accepted

Solution code:
H,N=map(int,input().split())
A=input().split()
K=[]
for i in A:
    K.append(int(i))
if sum(K)>=H:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
H, N = map(int, input().split())
A_list = list(map(int, input().split()))

for i in range(0,N):
    H = H - A_list[i]

if H<=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
H, N = map(int, input().split())
A=list(map(int, input().split()))

atack= sum(A)
if H-atack<=0:
    print("Yes")
elif H-atack>0:
    print("No")

Submission status: Accepted

Solution code:
H,N = map(int, input().split())
A = list(map(int, input().split()))
c=0
for i in range(N):
    c+=A[i]
if c>=H:
    ans="Yes"
else:
    ans="No"
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
t = []
t = list(map(int, input().split()))

n = t.pop()
h = t.pop()

a = []
a = list(map(int, input().split()))

s = sum(a)

if h <= s:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

h,n = list(map(int,input().split()))
a = list(map(int,input().split()))

if h <= sum(a):
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
H,N=map(int,input().split())
A=list(map(int,input().split()))
if sum(A)>=H:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

As = map(int,input().split())

print('Yes' if sum(As)>=H else 'No')

Submission status: Accepted

Solution code:
import numpy as np
H,N = list(map(int,input().split()))
A = list(map(int,input().split()))

s = np.array(A).sum()

if s >= H:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
h, n = map(int, input().split())
li = list(map(int, input().split()))
li.sort(reverse=True)
ans = 'No'
for i in li:
  if n <= 0:
    break
  h = h - i
  n -= 1
if h <= 0:
  ans = 'Yes'
  
print(ans)

Submission status: Accepted

Solution code:
H, N = [int(num) for num in input().split(' ')]
sum=0

for Ai in [int(num) for num in input().split(' ')]:
  sum += Ai
  
if sum >= H:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
h, n = tuple(map(int, input().split()))
arts = list(map(int, input().split()))
print("Yes" if h <= sum(arts) else "No")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
h=list(map(int,input().split()))
t=0
for i in h:
  t+=i
if a>t:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = "Yes"
if sum(a) < h:
    ans = "No"
print(ans)

Submission status: Accepted

Solution code:
def main(h: int, n: int, a: list):
    for i in sorted(a):
        h -= i
        if h <= 0:
            print("Yes")
            return

    print("No")


if __name__ == "__main__":
    h, n = map(int, input().split())
    a = list(map(int, input().split()))

    main(h, n, a)

Submission status: Accepted

Solution code:
H, N = map(int, input().split())
lista = list(map(int, input().split()))
#print(lista)
ans = sum(lista)
#print(ans)
if ans >= H:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# your code goes here
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
if(sum(a)>=n):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
if sum(a) >= h:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
from sys import stdin
H,N = [int(x) for x in stdin.readline().rstrip().split()]
A = [int(x) for x in stdin.readline().rstrip().split()]
if H <= sum(A):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

a = sum(nums)

if h - a <= 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
data = input().split()
strengh = int(data[0])
attack = input().split()
attack = sum([int(a) for a in attack])
if strengh > attack:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
[h, n] = list(map(int, input().split()))

sum = 0
for a in input().split():
  a = int(a)
  sum += a

if sum >= h:
  print("Yes")
else: 
  print("No")

Submission status: Accepted

Solution code:
attack=list(map(int,input().split()))
damage=list(map(int,input().split()))
A=0
for i in range(attack[1]):
  A+=damage[i]

if A>=attack[0]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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