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


def main():
    input = lambda: stdin.readline()[:-1]
    H, N = map(int, input().split())
    A = map(int, input().split())

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


main()

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

Submission status: Accepted

Solution code:
import sys
from random import choice,randint
inp=sys.stdin.readline
out=sys.stdout.write
flsh=sys.stdout.flush
 
sys.setrecursionlimit(10**9)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def MI(): return map(int, inp().strip().split())
def LI(): return list(map(int, inp().strip().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]
def LI_(): return [int(x)-1 for x in inp().strip().split()]
def LF(): return [float(x) for x in inp().strip().split()]
def LS(): return inp().strip().split()
def I(): return int(inp().strip())
def F(): return float(inp().strip())
def S(): return inp().strip()
def pf(s): return out(s+'\n')
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)

def main():
    h,n=MI()
    a = LI()
    s = sum(a)
    if h-s<=0:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
h, n = map(int,input().split())
L = [int(i) for i in input().split()]

s = sum(L)
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()))
A.sort(reverse=True)
for i in range(N):
  H -= A[i]
print("Yes" if H <= 0 else "No")

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

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

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

Submission status: Accepted

Solution code:
import math

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:

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

if __name__ == "__main__":
    resolve()

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:
def main():
    H, N = map(int, input().split())
    A = list(map(int, input().split()))
    sA = sum(A)
    if H <= sA:
        print('Yes')
    else:
        print('No')
    

main()

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:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    H, N = map(int, input().split())
    A = tuple(map(int, input().split()))
    if sum(A) >= H:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#B
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:
(n, k), *D,  = [list(map(int, s.split())) for s in open(0)]
D = D[0]
if sum(D) >= n:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

    isWin = False

    for num in num_list:
        h -= num
        if h <= 0:
            isWin = True
            break

    print('Yes' if isWin else 'No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
H, N=list(map(int, input().split()))
A = list(map(int, input().split()))
sum=0
for n in range(N):
    sum += A[n]
if sum>=H:
    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 = list(map(int, input().split()))
aaa = list(map(int, input().split()))
print('Yes' if sum(aaa) >= h else 'No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
H,N=map(int, input().split())
c=sum(list(map(int, input().split())))
if H<=c:
  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("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
def main():
    H, N = map(int, input().split())
    AN = list(map(int, input().split()))

    ans = "Yes" if H - sum(AN) <= 0 else "No"

    print(ans)


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inputs = input().split(" ")
h = int(inputs[0])
n = int(inputs[1])
a = input().split(" ")

all = 0
for i in range(n):
    a[i] = int(a[i])
    all += a[i]

print("Yes" if h <= all else "No")

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/bin/bash
''':'
docker run --rm -it -v $(cd $(dirname $0) && pwd):/vo:ro pypy:3-2.4.0 \
   /bin/bash -c "pypy3 /vo/$(basename $0) < /vo/g.inp"
exit $?
'''
import sys


def _ia(): return [int(x) for x in sys.stdin.readline().strip().split()]


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(H, N, A):
    H -= sum(A)
    return 'Yes' if H <= 0 else 'No'


def main():
    H, N = read_int_n()
    A = read_int_n()
    print(slv(H, N, A))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
h, n = [int(s) for s in input().strip().split()]
A = [int(s) for s in input().strip().split()]
result = "Yes" if sum(A) >= h else "No"
print(result)

Submission status: Accepted

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

for i in range(n):
    h-=a[i]
    if h<=0:
        break
if h<=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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 = map(int, input().split())
A = sorted(list(map(int, input().split())))[::-1]
if sum(A[:N]) >= 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()]
print("Yes") if sum(a) >= h else print("No")

Submission status: Accepted

Solution code:


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


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

Submission status: Accepted

Solution code:
H,N=map(int, input().split())
A = list(map(int, input().split()))
total=0
for i in range(len(A)):
  total+=A[i]
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()))

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

print(ans)

Submission status: Accepted

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

H, _ = list(map(int, input().split()))
atk = sum(list(map(int, input().split())))

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
A=list(map(int,input().split()))
num=0
for i in A:
    num+=i

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

Submission status: Accepted

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

h,n = get_nums_l()
aaa = get_nums_l()
s = sum(aaa)

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    h, n = MAP()
    A = LIST()
    if h <= sum(A):
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

class Solution:
    def solve(self, H, n, moves):
        moves.sort(reverse=True)

        health = H

        for move in moves:
            health -= move

            if health <= 0:
                return True

        return False


sol = Solution()

[H, n] = list(map(int, input().strip().split()))
moves = list(map(int, input().strip().split()))

print("Yes" if sol.solve(H, n, moves) else "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-1:
  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())
aa = map(int, input().split())
print('Yes' if sum(aa) >= h else 'No')

Submission status: Accepted

Solution code:
import math
import calendar
import fractions
import itertools

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()))
total=0
for i in range(n):
    total+=a[i]
print("Yes" if h<=total else "No")

Submission status: Accepted

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

if H - sum(A) <= 0:
    ans = "Yes"
else:
    ans = "No"
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

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

s = np.sum(A)

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

Submission status: Accepted

Solution code:
import numpy as np

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

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

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

Submission status: Accepted

Solution code:
# coding: utf-8

H, N = map(int, input().split(' '))
A = [int(a) for a in input().split(' ')]

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

Submission status: Accepted

Solution code:
import math
H,N = map(int,input().split())
L = list(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()))

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


damage = sum(A)
if H-damage > 0:
    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:
import collections
import math
import operator as op
from functools import reduce
import numpy as np
import math
import bisect
import heapq


MOD = 1000000007


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


def get_inputs(cast_func=None):
    if cast_func is None:
        return input().split()
    else:
        return list(map(cast_func, input().split()))


def get_input(cast_func=None):
    if cast_func is None:
        return input()
    else:
        return cast_func(input())


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


def main():
    # H, A = get_inputs(int)

    # ans = 0
    # while H > 0:
    #     H -= A
    #     ans += 1
    # print(ans)

    H, N = get_inputs(int)
    A = get_inputs(int)

    if sum(sorted(A)[-N:]) >= H:
        print('Yes')
    else:
        print('No')


    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

for i in range(0, N):
    H -= AList[i]
    if H <= 0:
        print('Yes')
        sys.exit(0)
        

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("Yes")
        exit()

print("No")

Submission status: Accepted

Solution code:
h, n = map(int, input().split(' '))
s = sum(sorted(map(int, input().split(' ')), reverse=True)[0:n])
print('Yes' if h <= s else '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 = [int(x) for x in input().split()]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
H,N=map(int,input().split())
A=list(map(int,input().split()))
print('Yes' if H <= sum(A) else '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())
sum_a = sum([int(a) for a 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()))

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

Submission status: Accepted

Solution code:
import math
def A():
    temp = [int(i) for i in input().split()]
    print(int(math.ceil(temp[0]/temp[1])))

def B():
    temp = [int(i) for i in input().split()]
    H = temp[0]
    N = temp[1]
    A = [int(i) for i in input().split()]
    if H <= sum(A):
        print('Yes')
    else:
        print('No')

B()

Submission status: Accepted

Solution code:
H, N = (int(x) for x in input().split())

S = sum(int(x) for x in input().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
h, n = map(int, input().split())
l = list(map(int, input().split()))
s = 0
for i in l:
    s += i
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 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()))


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

Submission status: Accepted

Solution code:
import math
import decimal
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

class Library():
    @staticmethod
    def Swap(a,b):
        return [b,a]

    @staticmethod
    def myRound(a,dig=0): # 四捨五入
        p = 10 ** dig
        return (a * p * 2 + 1) // 2 / p

    @staticmethod
    def Roundup(a,dig=0): # 切り上げ
        if a < 0:
            return int(a)
        else:
            return int(a + 0.9)

    @staticmethod
    def Gcd(a,b): #最大公約数
        if (a<b):
            a,b = Library.Swap(a,b)
        if (b==0):
            return a
        else:
            return Library.Gcd(b,a%b)

    @staticmethod
    def Lcm(a,b): #最小公倍数
        return a//Library.Gcd(a,b)*b

    @staticmethod
    def Divisors(a): # 約数列挙
        divisors = []
        for i in range(1,int(a**0.5)+1):
            if a%i==0:
                divisors.append(i)
                if i!=a//i:
                    divisors.append(a//i)
        divisors.sort()
        return divisors

class Prime():
    # コンストラクタ
    # エラストテネスの篩
    def __init__(self,num):
        self.num = num
        self.sieve = [0] * (self.num + 1)
        self.sieve[0] = -1
        self.sieve[1] = -1
        for i in range(2,self.num + 1):
            if not self.sieve[i]:
                self.sieve[i] = i
                for j in range(i * i,self.num + 1,i):
                    if self.sieve[j]:
                        self.sieve[j] = i
    
    # 素数判定
    def isPrime(self,num = None):
        if num is None:
            num = self.num
        if self.sieve[num] == num:
            return True
        else:
            return False
    
    # 素数列挙
    def PrimeNum(self,num = None):
        if num is None:
            num = self.num
        prime = []
        for i in range(2,num):
            if self.sieve[i] == i:
                prime.append(i)
        return prime
    
    # 素因数分解
    def PrimeFact(self,num = None):
        if num is None:
            num = self.num
        fact = []
        while self.sieve[num] != num:
            fact.append(self.sieve[num])
            num //= self.sieve[num]
        fact.append(num)
        return fact

def main():
    h,n = map(int,input().split())
    a = list(map(int,input().split()))
    if h <= sum(a):
        print('Yes')
    else:
        print('No')
    return

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
h, n = map(int, input().split())
a = [int(x) for x 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 H <= sum(A):
    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')

Submission status: Accepted

Solution code:
h,n=map(int,input().split())
ls=list(map(int,input().split()))
if h<=sum(ls):
    print('Yes')
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 = [int(v) for v in input().split()]
attacks = [int(v) for v in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
H, N = list(map(int, input().split()))
A = sorted(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()))

print("Yes" if sum(A)>= H else "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=[int(i) for i in input().split()]

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

Submission status: Accepted

Solution code:
import math

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

alist=sorted(alist)
atk=0
for i in range(min(n, len(alist))):
    atk+=alist[len(alist)-1-i]

#print(atk)
if atk>=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 sum(A) >= H:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import math
import sys
#n = int(input())
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 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	H,N = inputMap()
	A = inputList()

	tmp = 0
	for i in A:
		tmp += i

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


if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline())
def LI(): return [int(x) for x in sys.stdin.readline().split()]

def main():
    H,N = LI()
    A = LI()
    if sum(A) >= H:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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:
# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read

#n,*w = [int(i) for i in read().split()]
#n,*t = map(int,read().split())

#n = int(input())
#s = input()
h,n = [int(i) for i in readline().split()]

a = [int(i) for i in readline().split()]


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

Submission status: Accepted

Solution code:
n,h=map(int,input().split())
a=list(map(int,input().split()))
if sum(a)<n:
    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()))

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

Submission status: Accepted

Solution code:
#import sys
MOD = 10 ** 9 + 7
#input = sys.stdin.readline
import math

import itertools

#import bisect

import copy


def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]
def main():
    h,n=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())
l = list(map(int,input().split()))
s = sum(l)

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

for i in range(n):
    h -= a[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()))

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

Submission status: Accepted

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

if sum(Alist) >= 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(H <= S): print('Yes')
else: print('No')