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

Solution code:
H,N = map(int,input().split())
A = list(map(int,input().split()))
ans = 0
for row in A:
  ans += row
if ans >= H:
  print('Yes')
else:
  print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if sum(total) >= H and len(total) <= N:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools

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

# 組み合わせ
p = list(itertools.combinations(A,2))

ans = "No"

for i in range(len(p)):
    if sum(p[i]) > M[0]:
        ans = "Yes"
        break

print(ans)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
h,n=map(int,input().split())
l=[int(x) for x in input().split()]
if sum(l)>=h:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

attack = 0
for i in range(len(lis)):
    attack = attack + int(lis[i])

if attack >= h:
    print('Yes')
else:
    print('')

Submission status: Wrong Answer

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

attack = 0
for i in reversed(A):
  if attack >= H:
    print("Yes")
    break
  else:
    attack += i
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
L = list(map(int,input().split()))
L.sort()
if b<=2:
    print("No")
    exit()

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

Submission status: Wrong Answer

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

if sum(As) < H:
    print('NO')
else:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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
if a:
  print("No")

Submission status: Wrong Answer

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

for a in A:
  H -= a
  if H > 0 and a == A[N-1]:
    print("No")
    break
  elif H <= 0:
    print("Yes")
    break

Submission status: Wrong Answer

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
if count >= H:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
h,n=map(int,input().split())
a=list(map(int,input().split()))
s=0
f=0
for i in range(n):
    s=s+a[i]
    if(s>=h):
        f=1
        break
if(f==1):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 h <= sum:
    print('yes')
else:
    print('no')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,n=[int(i) for i in input().split()]
t=[int(i) for i in input().split()]
if sum(t)>=h:print("yes")
else:print("no")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Solution code:
h,n=map(int,input().split())
l=[int(x) for x in input().split()]
if sum(l)>h:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

attack = 0
for i in reversed(A):
  if attack > H:
    print("Yes")
    break
  else:
    attack += i
else:
  print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

atk = 0
n_list.sort()
for i in range(n):
    h = h - n_list[i]
    if h <= 0:
        print ("yes")
        exit (0)

print ("No")

Submission status: Wrong Answer

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

T = 0
for i in range(N):
    T += A[i]
#print(H,T)
if H <= T:
    print('Yes')
else:
    print('no')

Submission status: Wrong Answer

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

Solution code:
import sys
read = sys.stdin.read

h,n,*lst=map(int, read().split())
s=sum(lst)
if s<=h:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 N <= sum(A):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import itertools
import sys
H,N = map(int,input().split())
L = [_ for _ in map(int,input().split())]
#Hitpoint with L?
for i in range(1,N):
    Attack = list(itertools.permutations(L,i))
    for pattern in Attack:
        if sum(pattern) == H:
            print('Yes')
            sys.exit(0)
print('No')

Submission status: Wrong Answer

Solution code:
"""
NTC here
"""
import sys
inp= sys.stdin.readline
input = lambda : inp().strip()
flush= sys.stdout.flush
# import threading
# sys.setrecursionlimit(10**6)
# threading.stack_size(2**25)

def iin(): return int(input())
def lin(): return list(map(int, input().split()))

# range = xrange
# input = raw_input


def main():
    h, n = lin()
    a = lin()
    sm = sum(a)
    print('Yes' if h<sm else 'No')



            
        

        
main()
# threading.Thread(target=main).start()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

summ = sum(A)

if summ <= h:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

Solution code:

H,N=map(int, input().split())
A=list(map(int,input().split()))
A.sort()
count=0
print(A)
for i in range(N):
    count=count+A[i]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    h,n = map(int,input().split())
    a_lst = list(map(int,input().split()))
    for attack in a_lst:
        h == attack
    if h <= 0:
        print("Yes")
    else:
        print("No")



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


n,a=map(int,input().split())
arr=list(map(int,input().split()))
flag=0
for i in range(a):
    n=n-arr[i]
    if(n<=0):
        flag=1
if(flag):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
# import itertools
# import math


def solve(H, N, A):
    if (sum(A) > H):
        return 'Yes'
    return 'No'


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

# P = []
# S = []
# for i in range(N):
#     pp, ss  = map(int, input().split())
#     P.append(pp)
#     S.append(ss)

print(solve(H, N, A))

Submission status: Wrong Answer

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

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

# 強い順に並び替え
A.sort()

for a in A:
    H -=a
    if H<=0:
        print("Yes")
        exit()
    else:
        continue

print("N0")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

print(-(-H//A))

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
a = list(map(int, input().split()))
print("yes" if sum(a) >= x else "no")

Submission status: Wrong Answer

Solution code:

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

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

S = sum(A)

print("yes" if H <= S else "no")

Submission status: Wrong Answer

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

if sum(A) >= H:
    ans = "YES"
else:
    ans = "NO"

Submission status: Wrong Answer

Solution code:
h, n = map(int, input().split())
a = list(map(int, input().split()))
sums = sum(a)
if sums >= h:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Time Limit Exceeded

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

waza = 0
for i in range(0, N):
    waza = waza + int(A.split()[i])

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
h,n = map(int,input().split())
a = list(map(int,input().split()))
 
for i in range(len(a)):
  h -= max(a)
  a.remove(max(a))
  if h <= 0:
    print('Yes')
    exit()
    
print('No')

Submission status: Time Limit Exceeded

Solution code:
H,N = map(int,input().split())
A = list(map(int,input().split()))
ln = len(A)
count = [0]*len(A)

def fight(A,H,count,ln):
    while 1:
        if A == [0] * ln:
            return 'No'
        if H > 0:
            H -= max(A)
            ix = A.index(max(A))
            count[ix] += 1
            if count[ix] == 1:
                A[ix] = 0
        if H <= 0:
            return 'Yes'

print(fight(A,H,count,ln))

Submission status: Time Limit Exceeded

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

for i in range(N):
    m=max(A)
    H-=m
    if(H <= 0):
        print('Yes')
        sys.exit()
    A.remove(m)
print('No')

Submission status: Time Limit Exceeded

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

atk=0
for i in range(len(a)):
    atk+=max(a)
    a.remove(max(a))

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

Submission status: Time Limit Exceeded

Solution code:
h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
i = 0
while (i < n):
  if(a[i] <= 0):
    print("Yes")
print("No")

Submission status: Time Limit Exceeded

Solution code:
import itertools
 
H, N = map(int, input().split())
A = list(map(int, input().split()))
 
ans = 'No'
 
for i in itertools.product([True, False], repeat=N):
    if sum([A[j] for j in range(len(A)) if i[j]]) == H:
        ans = 'Yes'
print(ans)

Submission status: Time Limit Exceeded

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

f = [1] + [0 for i in range(1, H+1)]
flag = 0
for i in range(N):
  for j in range(H-D[i], -1, -1):
    if f[j] == 1:
      f[j+D[i]] = 1
  if f[-1] == 1:
    print("Yes")
    flag = 1
    break
if flag == 0:
  print("No")

Submission status: Time Limit Exceeded

Solution code:
h, n = input().split()
h = int(h)
n = int(n)
attack = list(map(int, input().split()))
while  n > 0:
    m_attack = max(attack)
    if h - m_attack <= 0:
        h = h - m_attack
        print("Yes")
        break
    else:   
        h = h - m_attack
        attack.remove(m_attack)
        n = n-1
if h > 0:
    print("No")

Submission status: Time Limit Exceeded

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

count = 0
sum2 = []
for i in range(2 ** N):
        sum1 = []
        for j in range(len(A)):
            if ( i >> j) & 1 == 1:
                sum1.append(A[j])
        if sum(sum1) == H:
            count = 1
            print("Yes")
            break


if count == 0:
    print("No")

Submission status: Time Limit Exceeded

Solution code:
import math
h, n = input().split()
h = int(h)
n = int(n)
attack = list(map(int, input().split()))
while  n > 0:
    m_attack = max(attack)
    if h - m_attack <= 0:
        h = h-m_attack
        print("Yes")
        break
    else:   
        h = h - m_attack
        attack.remove(m_attack)
        n = n-1
if h > 0:
    print("No")

Submission status: Time Limit Exceeded

Solution code:
a = []
a = input().split()
H = int(a[0])
N = int(a[1])
A = input().split()
A = [int(i) for i in A]

#print('H=', H, 'N=', N)
#print('A=', A)

for i in range(N):
  n = A.index(max(A))
#  print('n=', n)
  H = H - max(A)
  A.remove(A[n])
#  print('A=', A)

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

Submission status: Time Limit Exceeded

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

count = 0
sum2 = []
for i in range(2 ** N):
        sum1 = []
        for j in range(len(A)):
            if ( i >> j) & 1 == 1:
                sum1.append(A[j])

        sum2.append(sum(sum1))

if sum2.count(H) == 0:
    print("No")
else :
    print("Yes")

Submission status: Time Limit Exceeded

Solution code:
h,m = map(int, input().split())
atack = list(map(int, input().split()))

atack_select=[] #候補を保存しておくリスト

for i in range(m):
    atack_select.append(max(atack))
    atack.remove(max(atack)) #最大値を消していく

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

Submission status: Time Limit Exceeded

Solution code:
H, N = map(int, input().split())
D = list(map(int, input().split()))
p = [0]
flag = 0
for d in D:
  p = p + [i+d for i in p]
  if H in p:
    flag = 1
    break
if flag == 1:
  print("Yes")
else:
  print("No")

Submission status: Time Limit Exceeded

Solution code:
a,b=map(int,input().split())
c=[int(x) for x in input().split()]
se=set()
import itertools
ok=False
for j in range(b):
    for i in itertools.permutations(c,r=j+1):
        if sum(i)>=a:
            ok=True
            break
    if ok:
        break
if ok:
    print("Yes")
else:
    print("No")

Submission status: Time Limit Exceeded

Solution code:
a,b=map(int,input().split())
c=[int(x) for x in input().split()]
se=set()
import itertools
ok=False
for j in range(b):
    for i in itertools.permutations(c,r=j+1):
        se.add(i)
    for i in se:
        if sum(i)>=a:
            ok=True
            break
    if ok:
        break
        
if ok:
    print("Yes")
else:
    print("No")

Submission status: Time Limit Exceeded

Solution code:
import itertools
import sys
H,N = map(int,input().split())
Attacks = [_ for _ in map(int,input().split())]
Attacks.sort(reverse = True)
if sum(Attacks) < H:
    print('No')
    sys.exit(0)
else:
    for i in range(1,N+1):
        if sum(Attacks[0:i]) >= H:
            print('Yes')
            sys.exit(0)
print('No')

Submission status: Time Limit Exceeded

Solution code:
import itertools

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

ans = 'No'

for i in itertools.product([True, False], repeat=N):
    if sum([A[j] for j in range(len(A)) if i[j]]) == H:
        ans = 'Yes'
print(ans)

Submission status: Time Limit Exceeded

Solution code:
h,n = map(int,input().split())
li = list(map(int,input().split()))
ls =[]
for i in range(n):
    m = li.index(max(li))
    ls.append(li.pop(m))

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

Submission status: Time Limit Exceeded

Solution code:
h,n = map(int,input().split())
a_list = list(map(int,input().split()))
def part_sum(a,A):
    #初期化
    N = len(a)
    dp = [[0 for i in range(A+1)] for j in range(N + 1)]
    dp[0][0] = 1
    
    #DP
    for i in range(N):
        for j in range(A+1):
            if a[i] <= j :
                dp[i + 1][j] = dp[i][j - a[i]] or dp[i][j]
            else :
                dp[i +1][j] = dp[i][j]
    return dp[N][A]
if part_sum(a_list,h) ==0:
  print("No")
else:
  print("Yes")

Submission status: Time Limit Exceeded

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]"):
    for i in range(N):
        H-=max(A)
        A.remove(max(A))
        if H<=0:
            print(YES)
            break
    else:
        print(NO)
    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: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

def part_sum0(a,H):
  #初期化
  N=len(a)
  dp=[[0 for i in range(H+1)] for j in range(N+1)]
  dp[0][0]=1

  #DP
  for i in range(N):
    for j in range(H+1):
      if a[i]<=j: #i+1番目の数字a[i]を足せるかも
        dp[i+1][j]=dp[i][j-a[i]] or dp[i][j]
      else: #入る可能性はない
        dp[i+1][j]=dp[i][j]
  return dp[N][H]

res = part_sum0(a,H)

if res:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
H, N, *A = map(int, open(0).read().split())
print("Yes") if H <= sum(A) else print("No")

Submission status: Accepted

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

print('Yes') if sum(a)>=h 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()))
flag = False

for a in A:
  h -= a
  if h<=0:
    flag = True
    break

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

Submission status: Accepted

Solution code:
h,n = map(int,input().split())
lst = list(map(int,input().split()))
if sum(lst) < h:
  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 = map(int,input().split())
lsA = list(map(int,input().split()))
print('Yes' if H <= sum(lsA) else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

for move in a:
    move = int(move)
    attack.append(move)

result = h - sum(attack)
if result <= 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
H,N=map(int,input().split())
A=list(map(int,input().split()))
s=0
flg=True
for i in range(N):
  s+=A[i]
  if s>=H:
    print('Yes')
    flg=False
    break
if flg:
	print('No')

Submission status: Accepted

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

if H - sum(data) > 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

x = sum(a)

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

Submission status: Accepted

Solution code:
# モンスターの体力は H
# アライグマは N 種類の必殺技を使うことができ
# i番目の必殺技を使うとモンスターの体力を Ai 減らすことができます。
# モンスターの体力を0以下にすれば、アライグマ勝ち
# アライグマが同じ必殺技を 2 度以上使うことなくモンスターに勝つことができるなら Yes を、
# できないなら No を出力してください。

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

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

Submission status: Accepted

Solution code:
# モンスターの体力は H
# アライグマは N 種類の必殺技を使うことができ
# i番目の必殺技を使うとモンスターの体力を Ai 減らすことができます。
# モンスターの体力を0以下にすれば、アライグマ勝ち
# アライグマが同じ必殺技を 2 度以上使うことなくモンスターに勝つことができるなら Yes を、
# できないなら No を出力してください。

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

if H - sum(data) > 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
h, n, *a = map(int, open(0).read().split())
print(["No", "Yes"][h <= sum(a)])

Submission status: Accepted

Solution code:
import numpy as np

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

if H<=np.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 H - sum(A) <= 0:
    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("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("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#アライグマはモンスターと戦っています。
# モンスターの体力は H です。
#アライグマは N 種類の必殺技を使うことができ、
#i 番目の必殺技を使うとモンスターの体力を Ai 減らすことができます。
#モンスターの体力を 0 以下にすればアライグマの勝ちです。

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

if H - sum(A) <= 0:
    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(len(A)):
    sum+=A[i]
if H<=sum :
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

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

Total_attack = sum(A)

if H - Total_attack <= 0:
    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()))

answer = sum(A)

if answer >= 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('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
# モンスターの体力は H
# アライグマの必殺技は N 種類
# アライグマが同じ必殺技を 2 度以上使うことなく
# モンスターに勝つことができるなら Yes を、
# できないなら No を出力。

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

a = (sum(A))

if a >= H:
    ans = "Yes"
else:
    ans = "No"

print(ans)

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