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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

h,n=MAP()
a=LIST()
b=sum(a)
if h<=b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    H, N = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

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


    
    
    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
from math import ceil
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:
def main():
    H, N = map(int, input().split())
    A = list(map(int, input().split()))
    print('Yes' if H <= sum(A) else 'No')

main()

Submission status: Accepted

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

Submission status: Accepted

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


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

print(ans)

Submission status: Accepted

Solution code:
# ABC153b


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10 ** 6)

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import fractions
import math
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

H, N = IL()
a = IL()
num = sum(a)

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

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

h,a = m()

b = l()

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def yes():
    print("Yes")  # type: str


def no():
    print("No")  # type: str


def solve(H: int, N: int, A: "List[int]"):
    if H > sum(A):
        no()
    else:
        yes()
    return


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:
import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial, ceil, floor
from collections import defaultdict
import itertools
sys.setrecursionlimit(200000)
input = sys.stdin.readline

# N, M, = map(int, input().split())
# N = int(input())
# L = [int(v) for v in input().split()]
# L = [[int(v) for v in input().split()] for _ in range(N)]
# L = [int(input()) for _ in range(N)]
# L = [list(input().strip())  for _ in range(N)]
# S = input().strip()

H, N, = map(int, input().split())
L = [int(v) for v in input().split()]

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

Submission status: Accepted

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

if a <= sum(l):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[] for _ in range(num)]
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

H,N = II()
A = III()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

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

#Solve
if __name__ == "__main__":
    solve()

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:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

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

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    h,n=MI()
    aa=LI()
    if sum(aa)>=h:print("Yes")
    else:print("No")

main()

Submission status: Accepted

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

import sys
sys.setrecursionlimit(300000)

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

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

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: Runtime Error

Solution code:
import sys
H,N=map(int,input().split())
A=map(int,input().split())
s=0
for i in range(N):
  s+=A[i]
  if s>=H:
    print('Yes')
    sys.exit()
print('No')

Submission status: Runtime Error

Solution code:
'''
問題：
    アライグマはモンスターと戦っています。

    モンスターの体力は H です。
    アライグマは N 種類の必殺技を使うことができ、
    i 番目の必殺技を使うとモンスターの体力を Ai 減らすことができます。
    必殺技を使う以外の方法でモンスターの体力を減らすことはできません。

    モンスターの体力を 0 以下にすればアライグマの勝ちです。

    アライグマが同じ必殺技を
    2 度以上使うことなくモンスターに勝つことができるなら Yes を、
    できないなら No を出力してください。
'''

'''
制約：
    1 ≦ H ≦ 1000000000
    1 ≦ N ≦ 100000
    1 ≦ Ai ≦ 10000
    入力中のすべての値は整数である。
'''

# 標準入力から H, N, Ai を取得する
h, m = map(int, input().split())
a = list(map(int, input().split()))

# 必殺技を1回ずつ使った場合、モンスターの体力をどれだけ削れるか計算する
# hissatsu_hp = 0
# for i in range(0, m):
#     hissatsu_hp += a[i]
hissatu_hp = sum(a)

# 同じ必殺技を使わずアライグマを倒せるか判定して結果を出力する
result = ""
if hissatsu_hp >= h:
    result = "Yes"
else:
    result = "No"

print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

H, N = map(int, input().split())
damege = map(int, input().split())
damege_list = [damege]

damege.sort()

if H - (damege[-1] + damege[-2]) <= 0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

damege.sort()

if H - (damege[-1] + damege[-2]) <= 0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Damage = []
for i in range(1,N+1):
    Ai = map(int, input().split())
    Damage.append(Ai)
Total_Damage = sum(Damage)

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

Submission status: Runtime Error

Solution code:
H, N = map(int, input().split())
A_list = []
for i in range(1, N+1):
    A_list.append("A_" + str(i))

A_list = int(input())
A_total = sum(A_list)

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

Submission status: Runtime Error

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

Damage = []
for i in range(1,N+1):
    Ai = int(input())
    Damage.append(Ai)
Total_Damage = sum(Damage)

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

Submission status: Runtime Error

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


for i in range(1,N+1):
    Damage = []
    Ai = int(input())
    Damage.append(Ai)
Total_Damage = sum(Damage)

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

Submission status: Runtime Error

Solution code:
# 入力
monster_hp, quantity_of_skills = map(int, input().split())
skills = map(int, input().split())
skills_list = [skills]

# 処理
total_damage = 0
for i in skills_list:
    total_damage += i

if monster_hp <= total_damage:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
# 入力
monster_hp = int(input())
quantity_of_skills = int(input())
skills = map(int, input().split())
skills_list = [skills]

# 処理
total_damage = 0
for i in skills_list:
    total_damage += i

if monster_hp <= total_damage:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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: Runtime Error

Solution code:
H,N = map(int, input().split())
lists = [] lists.append(int, input().split())
lists = lists.sort()
if N>=2 and lists[N-1]+lists[N-2]>=H:
  print('Yes')
If N==1 and lists[0]>=H:
  print('Yes')
if N==1 and lists[0]<H:
  print('No')
else:
  print('No')

Submission status: Runtime Error

Solution code:
210 5
31 41 59 26 53

Submission status: Runtime Error

Solution code:
H, N = map(int, input().split())
A = list(map(int, input().split()))
import itertools
a = list(itertools.combinations(A, 2))

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

Submission status: Runtime Error

Solution code:
r=input().split()
H=int(r[0])
N=int(r[1])
data=[int(s) for s in input().split()]
data.sort()
Data=data[::-1]
if Data[0]+Data[1]>=H:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import itertools

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

s = [sum(c) for c in list(itertools.combinations(a, 2))]

f = False
for i in range(n):
    if s[i] >= h:
        f = True
        break

print('Yes' if f == True else 'No')

Submission status: Runtime Error

Solution code:

# ABC153
# B Common Raccoon VS Monster
h, n = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
if a <= s:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
if sum(cc) >= a:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
H,A,B,C,D,E=map(int,input().split())
if A+B+C+D+E>+H:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
h,a,b,c,d,e=map(int,input().split())
if h<=a+b+c+d+e:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
h,a,b,c,d,e=map(int,input().split())
if h-a-b-c-d-e>=0:print("No")
else:print("Yes")

Submission status: Runtime Error

Solution code:
h,a,b,c,d,e=map(int,input().split())
if h-a-b-c-d-e>0:print("No")
else:print("Yes")

Submission status: Runtime Error

Solution code:
h,a,b,c,d,e=map(int,input().split())
if h-(a+b+c+d+e)<=0:print("Yes")
else:print("No")

Submission status: Runtime Error

Solution code:
h,n = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
print("Yes") if a[0] + a[1] > h else print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define len(x) (int)(x.size())
#define all(vs) vs.begin(), vs.end()
using ii = pair<int, int>;
using ll = long long;

int32_t main(){
	ios::sync_with_stdio(0);	
	ll h, n;
	cin >> h >> n;
	ll sum = 0;
	for(int i=0; i<n; ++i){
		ll x; cin >> x;
		sum += x;
	}
	if(sum>=h)
		cout << "Yes\n";
	else
		cout << "No\n";
}

Submission status: Runtime Error

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

if h <= a[-2] + a[-1]:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
h, n = map(int, input().split())
a = [int(x) for x in input().split()]
a.sort()
if h <= a[-2] + a[-1]:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(5):
  for j in range(5):
    if a[i] + a[j] >= h:
      l.append(1)
    else:
      l.append(0)

print('Yes' if sum(l) > 0 else 'No')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
M,N = list(map(int,input().split()))
s = list(map(int,input().split()))
s1 = sorted(s)

if M <= s1[-1] + s1[-2]:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

list = []

for i in range(n):
  a = int(input())
  list.append(a)

goukei = sum(list)

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

Submission status: Runtime Error

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

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

goukei = sum(a_list)

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

Submission status: Runtime Error

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

a_list = int(input()).split()

goukei = sum(a_list)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

A.sort()
if A[-1] + A[-2]>= H:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
h, n = map(int, input().split())
x = sorted([int(i) for i in input().split()], reverse = True)
if(x[0] + x [1] >= h):
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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: Runtime Error

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

ans = 'yes'

for i in range(N + 1):
    if new_A[1] + new_A[2] < H:
        ans = 'No'
    if N < 2:
        ans = 'No'

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
enemy=int(input())
skill=int(input())
for i in range(skill):
    damage=int(input())
    enemy=enemy-damage
if(enemy<=0):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
enemy,skill=map(int,input().split())
for i in range(skill):
    damage=int(input())
    enemy=enemy-damage
if(enemy<=0):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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: Runtime Error

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: Runtime Error

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

if MAX < H:
  print("No)
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma warning(disable : 4996)
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include<random>
#include<array>


using namespace std;

#define REP(i, n) for(int i = 0;i < n;++i)
#define REPR(i, n) for(int i = n-1;i >= 0;--i)
#define FOR(i, m, n) for(int i = m;i < n;++i)
#define FORR(i, m, n) for(int i = m-1;i >= n;--i)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define print(x) cout<<(x)<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define lb(v,n) lower_bound(v.begin(), v.end(), (n))
#define ub(v,n) upper_bound(v.begin(), v.end(), (n))
#define int long long
//#define double long double
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i,v.size())cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")
template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int>P;
typedef array<int, 3> arr3;
std::random_device rd;
std::mt19937 mt(rd());
constexpr ll MOD = 998244353; constexpr int MAX = 2000020;
const double pi = acos(-1); constexpr double EPS = 1e-8;
constexpr ll INF = 1e18;

void solve() {
	int H, N; cin >> H >> N;
	int sum = 0;
	REP(i, N) {
		int x; cin >> x;
		sum += x;
	}
	if (sum >= H)print("Yes");
	else print("No");
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int q; cin >> q;
	//while (q--)
	solve();
}

Submission status: Runtime Error

Solution code:
h, n = map(int, input().split())
Deathblow = list(map(int, input().split()))
for i in n:
  h -= Deathblow[i]
if h < 1:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
h,n = map(int,input().split())
a = input().split()
a.sort()
sum = int(a[-1]) + int(a[-2])
result = h - sum
if result <= 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

sum = int(a[-1]) + int(a[-2])

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

Submission status: Runtime Error

Solution code:
#h:体力 n:必殺技の数
#a:必殺技の威力

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

sum = int(a[-1]) + int(a[-2])

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

Submission status: Runtime Error

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