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:
h, n = map(int, input().lower().split())
a = map(int, input().lower().split())
a = list(a)
for i in range(0, len(a)):
  a[i] = int(a[i])

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

Submission status: Accepted

Solution code:
from sys import stdin


def main(inp1, inp2):
    h, n = [int(i) for i in inp1.split(sep=' ')]
    a_list = [int(i) for i in inp2.split(sep=' ')]
    if sum(a_list) >= h:
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    input1 = stdin.readline().rstrip()
    input2 = stdin.readline().rstrip()
    ret = main(input1, input2)
    print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

a.sort(reverse=True)

for x in a:
    h = h-x
    if h <= 0:
        break

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

Submission status: Accepted

Solution code:
import sys
import fractions
input = sys.stdin.readline
H, N = map(int, input().split())
A = list(map(int, input().split()))
Max = sum(A)
if H-Max <= 0:
    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()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S = np.sum(A_list)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

i=0
r=0

while(i<n):
  r+=list[i]
  i+=1

if(h<=r):
  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:
args = input().split()
args2 = input().split()
H = int(args[0])
N = int(args[1])
S = 0

for i in range(N):
	S += int(args2[i-1])

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(200000)

def dfs(i, total):
    if (i > A - 1):
        return False
    if (total - SPECIALS[i] <= 0):
        return True
    else:
        return dfs(i + 1, total - SPECIALS[i])

H, A = map(int, input().split())
SPECIALS = map(int, input().split())
SPECIALS = list(reversed(sorted(SPECIALS)))

print("Yes" if dfs(0, H) else "No")

Submission status: Accepted

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

#solve
def solve():
    h, n = LI()
    a = LI()
    print("Yes" if h <= sum(a) else "No")
    return


#main
if __name__ == '__main__':
    solve()

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 = list(map(int,input().split()))
a = list(map(int,input().split()))

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

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 = [int(i) for i in input().split()]
attacks = [int(i) for i in input().split()]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
inputnum = input().split(" ")
inputa = input().split(" ")
waza = 0

for i in range(int(inputnum[1])):
    waza += int(inputa[i])


result = int(inputnum[0]) - waza

if result <= 0:
    print("Yes")
elif result >0:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for a in A:
  H -= int(a)

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

Asum = sum(A)

if Asum >= 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()]

h -= sum(a)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
num = input().split(" ")
hpoint = int(num[0])
atk = int(num[1])
dmg = map(int,list(input().split(" ")))

if hpoint - int(sum(dmg)) <= 0:
  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,a=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, list(input().split()))
if H <= sum(A):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:

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


ma = sum(A)

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

Submission status: Accepted

Solution code:
def resolve():
    h, A = map(int, input().split())
    atk = list(map(int, input().split()))
    atk.sort(reverse=True)
    for i in atk:
        h -= i
        if h <=0:
            print("Yes")
            exit()
    if h<=0:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
import math
h,n = map(int, input().split())
a = sum(map(int, input().split()))
if a < 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:
  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 N == 0:
  print("No") 
elif H <= sum(A):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
H, N = map(int, input().lower().split())
total = 0
count = 0
A = []
input_string = input()
A = input_string.split()

for i in range(N):
    total = total + int(A[i])


while(True):
    H = H - total
    if H <= 0:
        count = count + 1
        break
    else:
        count = count + 1

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:
h,n=map(int, input().split())
a=list(map(int, input().split()))
x=0
for i in range(n):
    x+=a[i]
if h<=x:
    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 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(' ')))

sort_A = sorted(A, reverse=True)
if sum(sort_A[:N]) >= H:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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: 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=map(int,input().split())
S=map(int,input().split())

if H<=sum(S):
	print("Yes")
elif H>sum(S):
	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, n=map(int, input().split())
a=list(map(int, input().split()))
dmg=0
for i in range(n):
  dmg+=a[i]
if dmg>=h:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h, n = map(int, input().split()  ) #split()で分解したものを別々の変数に入れる
l = list(map(int, input().split()))  

a = sum(l)

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

Submission status: Accepted

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

sum = 0
for i in range(n):
    sum += a[i]
if h <= sum:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h, _ = map(int, input().split())
summation = sum(list(map(int, input().split())))

if h <= summation:
    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) <= 0:
    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()))
b = 0
for i in a:
    b += i
print("Yes" if b >= h else "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 = map(int, input().split())
A = list(map(int, input().split()))

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

Submission status: Accepted

Solution code:
def LI():
  return [int(s) for s in input().split()]

H,N = LI()
A = LI()

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

Submission status: Accepted

Solution code:

h, n = (int(x) for x in input().split())
a_list = list(map(int, input().split()))

if sum(a_list) < h:
    print('No')

else:
    print('Yes')

Submission status: Accepted

Solution code:
H, N = list(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())
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()))

a=sum(A)

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

Submission status: Accepted

Solution code:
val = input().split(' ')
h = int(val[0])
n = int(val[1])
skills = [int(i) for i in input().split(' ')]

able = 'No'
for i in skills:
    h -= i
    if h <= 0:
        able = 'Yes'
        break

print(able)

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:
#!/usr/bin/env python3
import sys

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


def solve(H: int, N: int, A: "List[int]"):
    A.sort()
    for i in range(N):
        H-=A[-1]
        del A[-1]
        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: Accepted

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

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())
attack_max = sum(list(map(int, input().split())))

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:
def main():
    H,N = (int(x) for x in input().split())
    a = list(map(int, input().strip().split()))
    if H - sum(a) > 0:
        print('No')
    else:
        print('Yes') 

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
h, _ = tuple(map(int, input().split(' ')))
A = list(map(int, input().split(' ')))
s = 0
for a in A:
    s+=a
    if s>=h:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

resolve()

Submission status: Accepted

Solution code:
H, N = map(int, input().split())
A = sorted(map(int, input().split()))
isWin = False
for i in A:
    H = H - i
    if H <= 0:
        isWin = True
        break

if (isWin):
    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:
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 = list(map(int, input().split()))
sorted_A_list = sorted(A_list, reverse=True)
m_H = H
for A in sorted_A_list:
    m_H -= A
    if m_H <= 0:
        print("Yes")
        exit()
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 = [int(x) for x in input().split()]
attacks = [int(x) for x in input().split()]
print("Yes" if H - sum(attacks) <= 0 else "No")

Submission status: Accepted

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

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

Submission status: Accepted

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: Accepted

Solution code:
import sys
import itertools
read = sys.stdin.buffer.read #全てまとめて文字列として格納
readline = sys.stdin.buffer.readline # 一行読む
readlines = sys.stdin.buffer.readlines # 全行リストに格納

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

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

Submission status: Accepted

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

ans = h
for i in range(n):
    ans -= a[i]

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

Submission status: Accepted

Solution code:
H,N = input().split()
H = int(H)
N = int(N)
A = list(map(int, input().split()))
A.sort()
while H > 0 :
    H = H - A[-1]
    del A[-1]
    if len(A) == 0:
        break
if H > 0 :
    print("No")
else :
    print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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: Accepted

Solution code:
h, n = map(int, input().split())
m = [i for i in input().split()]
result = 0
for i in m:
    result += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


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


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input().split()
h = int(s[0])
n = int(s[1])
s = input().split()
for i in s:
    h -= int(i)
    if h<=0:
        print('Yes')
        break
if h>0:
    print('No')

Submission status: Accepted

Solution code:
h, n = map(int, input().split())
atklist = map(int, input().split())
atk = 0
for i in atklist:
    atk += i

if atk < h:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

#出力
x=0
for i in range(len(A)):
    x+=A[i]
if H>x:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys,collections,math,random,fractions,bisect;sys.setrecursionlimit(10**7)
sr = sys.stdin.readline; P = print; P2 = lambda x: print(*x, sep="\n")
def I(i=0): t = [int(x)-i for x in sr().split()];return t
def S(): t = sr().split(); return t if len(t) > 1 else t[0]
L1,L2,L3,L4, = [],[],[],[]
 
H,N = I()
A = I()
if sum(A) >= H:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
from sys import stdin
lines = stdin.readlines()
 
H, N = map(int, lines[0].split())
A = sum(map(int, lines[1].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().strip().split()))
total = sum(a) 
if(h>total):
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
B = list(input().split(" "))
h = int(B[0])
n = int(B[1])
A = list(input().split(" "))
sum = 0
for i in range(len(A)):
    sum += int(A[i])
if (h<=sum):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
h,n=map(int,input().split())
a=[int(x) for x in input().split()]
x=sum(a)
if x>=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(n):
    total += a[i]
if total >= h:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

sum_damage = sum(A_list)

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

Submission status: Accepted

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

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

if input_line[0] <= sum(input_tec):
    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:
s = []
for i in range(2):
    s.append(input().split())
h = int(s[0][0])
n = int(s[0][1])
x = 0
for i in range(n):
    x = x + int(s[1][i])
if(h<=x):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

attack = sum(li)

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

a.sort()

if h<=sum(a[(-1)*n:]):
  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()))
attack_point = sum(a)
if h <= attack_point:
    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:
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

h,n = nm()
a = nl()
print("YNeos"[sum(a)<h::2])

Submission status: Accepted

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: Accepted

Solution code:
import sys
a = input().split()  
b= input().split()
k=0
for bb in b:
  k=k+int(bb)
if int(k)>=int(a[0]):
 print("Yes")
else:
 print("No")

Submission status: Accepted

Solution code:
import math

a, b = map(int, input().split())
print('Yes' if a - sum(map(int, input().split())) <= 0 else 'No')

Submission status: Accepted

Solution code:
import sys
import numpy as np

# H N モンスターの体力と必殺技の数
h, n = map(int, input().split())

# A1... 必殺技の与えるダメージ
a = list(map(int, input().split()))

for i in a:
    h -= i

if h > 0:
    # 倒せない
    print("No")
else:
    # 倒せる
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys

m=10**9 + 7 
sys.setrecursionlimit(1000010)
(H, N) = list(map(int,input().split()))
A  = list(map(int,input().split()))

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

Submission status: Accepted

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

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

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