CodeEff/ECCO huggingface dataset:
# Original solution
h, n = list(map(int, input().split()))
arr = list(map(int, input().split()))
if sum(arr) >= h: print('Yes')
else: print('No')

# Optimized solution
In1 = input().split()
h = int(In1[0])
n = int(In1[1])
ith = input().split()[0:n]
count = 0
for x in ith:
    h -= int(x)
    if h <= 0:
        break
if h > 0:
    print("No")
else:
    print("Yes")
# Original solution
H,N=list(map(int, input().split()))
A=[int(i) for i in input().split()]
Ans = "Yes" if H<=sum(A) else "No"
print(Ans)

# Optimized solution
H,N=map(int, input().split())
A=[int(i) for i in input().split()]
print("Yes") if H<=sum(A) else print("No")
# Original solution
h,n = list(map(int,input().split()))
a = list(map(int,input().split()))

for i in range(n):
    h = h - a[i]
    if h <= 0:
        print('Yes')
        exit(0)

print('No')

# Optimized solution
h,n = list(map(int,input().split()))
a = list(map(int,input().split()))
a = sum(a)
if a >= h:
    print('Yes')
else:
    print('No')
# Original solution
# Problem B - Common Raccoon vs Monster

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

# initialization
a_sum = sum(a_list)

# output
if h - a_sum<=0:
    print("Yes")
else:
    print("No")


# Optimized solution
# Problem B - Common Raccoon vs Monster

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

# initialization
a_sum = sum(a_nums)

# output
if a_sum>=H:
    print("Yes")
else:
    print("No")
# Original solution
h,n=list(map(int,input().split()))
if sum(list(map(int,input().split())))<h:
    print('No')
else:
    print('Yes')


# Optimized solution
h,n=list(map(int,input().split()))
print(('Yes' if sum(list(map(int,input().split())))>=h else 'No'))
# Original solution
H, N = list(map(int, input().split()))
A = list(map(int, input().split()))

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

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

print(('Yes' if H <= sum(A) else 'No'))
# Original solution
H, N = list(map(int, input().split()))
A = list(map(int, input().split()))

T = 0
for a in A: #for i in A だとAの要素を繰り返す
    T += a
if T >= H:
    print("Yes")
else:
    print("No")

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

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

s = sum (A)

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



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


if sum (A)>=H:
    print("Yes")
else:
    print("No")
# Original solution
h, n = list(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")

# Optimized solution
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


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

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


if __name__ == '__main__':
    resolve()
# Original solution
#template
from collections import Counter
def inputlist(): return [int(j) for j in input().split()]
H,N = inputlist()
A = inputlist()
s = sum(A)
if H <= s:
    print("Yes")
else:
    print("No")

# Optimized solution
#template
def inputlist(): return [int(k) for k in input().split()]
#template
H,N = inputlist()
A = inputlist()
s = sum(A)
if s >= H:
    print("Yes")
else:
    print("No")
# Original solution
h,n=list(map(int,input().split()))
l=list(map(int,input().split()))
print(('Yes' if sum(l)>=h else 'No'))

# Optimized solution
H, N = list(map(int, input().split()))
A = sum(map(int, input().split()))
print(("Yes" if H <= A else "No"))
# Original solution
H,N=list(map(int,input().split()))
A=sorted((list(map(int,input().split()))))
A=A[::-1]
print(("Yes" if sum(A[0:N])>=H else "No"))

# Optimized solution
H,N,*A=list(map(int,open(0).read().split()))
print(("Yes" if sum(A)>=H else "No"))
# Original solution
def main():
    h, n = list(map(int, input().split()))
    *a, = list(map(int, input().split()))
    print(('No' if h > sum(a) else 'Yes'))


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())


# Optimized solution
H, N = list(map(int, input().split()))
*A, = list(map(int, input().split()))
print(('Yes' if sum(A) >= H else 'No'))
# Original solution
H,N=list(map(int,input().split()))
A=sum(map(int,input().split()))
print(("Yes" if H-A<=0 else "No"))

# Optimized solution
H,N=list(map(int,input().split()))
A=sum(map(int,input().split()))
print(("Yes" if H<=A else "No"))
# Original solution
H, N = list(map(int, input().split()))
PP = list(map(int, input().split()))
print(("Yes" if sum(PP) >= H else "No"))

# Optimized solution
def resolve():
    H, N = list(map(int, input().split()))
    A = list(map(int, input().split()))
    print(("Yes" if sum(A) >= H else "No"))
resolve()
# Original solution
import itertools
import sys
H,N = list(map(int,input().split()))
Attacks = [_ for _ in map(int,input().split())]
Attacks.sort(reverse = True)
if sum(Attacks) < H:
    print('No')
    sys.exit(0)
else:
    for i in range(1,N+1):
        if sum(Attacks[0:i]) >= H:
            print('Yes')
            sys.exit(0)
print('No')


# Optimized solution
import sys
H,N = list(map(int,input().split()))
Attacks = [_ for _ in map(int,input().split())]
if sum(Attacks) < H:
    print('No')
    sys.exit(0)
if sum(Attacks) >= H:
    print('Yes')
    sys.exit(0)
# Original solution
H, N = list(map(int, input().split()))
A = list(map(int, input().split()))


def answer(H: int, N: int, A: list) -> str:
    damage = 0
    for i in range(0, N):
        damage += int(A[i])
        i += 1
    if damage < H:
        return 'No'
    else:
        return 'Yes'

print((answer(H, N, A)))


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

if H <= sum(A):
    print("Yes")
else:
    print("No")
# Original solution
H, N = list(map(int, input().split()))
A = list(map(int,input().split()))
sum = 0
for i in A:
    sum += i
if sum >= H:
    print('Yes')
else:
    print('No')

# Optimized solution
H, N = list(map(int, input().split()))
A = sum(list(map(int,input().split())))

if A >= H:
    print('Yes')
else:
    print('No')
# Original solution
H,N = list(map(int,input().split()))
A = list(map(int,input().split()))
if sum(A)>=H:
    print("Yes")
else:
    print("No")

# Optimized solution
H,N = list(map(int,input().split()))
A = list(map(int,input().split()))
tot = sum(A)
if tot>=H:
    print("Yes")
else:
    print("No")
# Original solution
import itertools
 
H, N = list(map(int, input().split()))
A = list(map(int, input().split()))
 
ans = 'No'
 
for i in itertools.product([True, False], repeat=N):
    if sum([A[j] for j in range(len(A)) if i[j]]) == H:
        ans = 'Yes'
print(ans)

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

total = sum(A)
if total >= H:
    print('Yes')
else:
    print('No')
# Original solution
H, N = list(map(int, input().split()))
D = list(map(int, input().split()))

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

# Optimized solution
H, N = list(map(int, input().split()))
A = list(map(int, input().split()))
if sum(A) >= H:
  print("Yes")
else:
  print("No")
# Original solution
import math
monsterHP, araiN = list(map(int, input().split()))
araiSum = sum(list(map(int, input().split())))

if monsterHP <= araiSum:
    print("Yes")
else:
    print("No")

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

if h <= sum(a): print("Yes")
else: print("No")
# Original solution
#!/usr/bin/env python3
import sys

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


def solve(H: int, N: int, A: "List[int]"):
    for i in range(N):
        H-=max(A)
        A.remove(max(A))
        if H<=0:
            print(YES)
            break
    else:
        print(NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(H, N, A)

if __name__ == '__main__':
    main()


# Optimized solution
#!/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()
# Original solution
h,n = list(map(int,input().split()))
a_list = list(map(int,input().split()))
def part_sum(a,A):
    #初期化
    N = len(a)
    dp = [[0 for i in range(A+1)] for j in range(N + 1)]
    dp[0][0] = 1
    
    #DP
    for i in range(N):
        for j in range(A+1):
            if a[i] <= j :
                dp[i + 1][j] = dp[i][j - a[i]] or dp[i][j]
            else :
                dp[i +1][j] = dp[i][j]
    return dp[N][A]
if part_sum(a_list,h) ==0:
  print("No")
else:
  print("Yes")

# Optimized solution
h,n = list(map(int,input().split()))
a_list = list(map(int,input().split()))
if sum(a_list) >= h:
  print("Yes")
else:
  print("No")
# Original solution
h, n = list(map(int, input().split()))

a = list(map(int, input().split()))
a.sort(reverse=True)

sum = 0
for i in a:
  sum += i
  if sum >= h:
    print('Yes')
    exit()

print('No')

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

if h - sum(a) <= 0:
  print('Yes')
else:
  print('No')
# Original solution
h,m = list(map(int, input().split()))
atack = list(map(int, input().split()))

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

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

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

# Optimized solution
h,m = list(map(int, input().split()))
atack = list(map(int, input().split()))

atack.sort(reverse=True) #降順に並び替え
atack_select = atack[:m]

if h - sum(atack_select) <= 0:
    print("Yes")
else:
    print("No")
# Original solution
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    h, n = list(map(int, input().rstrip('\n').split()))
    a = list(map(int, input().rstrip('\n').split()))
    print(("Yes" if sum(a) >= h else "No"))


if __name__ == '__main__':
    solve()


# Optimized solution
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    h, n = list(map(int, readline().split()))
    a = sum(list(map(int, readline().split())))
    print(("Yes" if a >= h else "No"))


if __name__ == '__main__':
    solve()
# Original solution
h , n = list(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')

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

if h <= sum(a):
    print('Yes')
else:
    print('No')
# Original solution
h, n = list(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")

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

aa = sum(a)

if aa >= h:
  print("Yes")
else:
  print("No")
# Original solution
import math

inputs = input().split(" ")
health, moves_num = int(inputs[0]), int(inputs[1])

moves_inp = input().split(" ")
moves = [int(move) for move in moves_inp]

can_win = False

for move in moves:
    health -= move
    if health <= 0:
        can_win = True
        break
print(("Yes" if can_win else "No"))

# Optimized solution
H,N=list(map(int,input().split()))
A=list(map(int,input().split()))
x=sum(A)
print(("Yes" if x>=H else "No"))
# Original solution
H,N=list(map(int,input().split()))
a=list(map(int,input().split()))

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

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

# Optimized solution
H,N=list(map(int,input().split()))
a=list(map(int,input().split()))
atk=0
for i in range(len(a)):
    atk+=a[i]

if atk>=H:
    print("Yes")
else:
    print("No")
# Original solution
h,n = list(map(int,input().split()))
li = list(map(int,input().split()))
ls =[]
for i in range(n):
    m = li.index(max(li))
    ls.append(li.pop(m))

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

# Optimized solution
h,n = list(map(int,input().split()))
li = list(map(int,input().split()))
if sum(li) >= h:
    print('Yes')
else:
    print('No')
# Original solution
h,n=list(map(int,input().split()))
print(("Yes"if sum(list(map(int,input().split())))>=h else "No"))

# Optimized solution
h, n = list(map(int, input().split()))
print(("Yes" if h <= sum(map(int, input().split())) else "No"))
# Original solution
# Input
h, n = input().split()
a = list(map(int, input().split()))

# Declaring variables
h = int(h)
n = int(n)
sum = 0

# Calculating the sum
for i in range(n):
    sum += a[i]

# Judging if the raccoon can win without using the same move twice or more.
if sum >= h:
    print("Yes")
else:
    print("No")








# Optimized solution
# Initializing variables
monsterHP, specialMoves = list(map(int, input().split()))
a = list(map(int, input().split()))
sum = 0

# Calculating if the raccoon can win without using the same move twice or more.
for i in range(specialMoves):
    sum += a[i]

if sum >= monsterHP:
    print("Yes")
else:
    print("No")
# Original solution
h, n = list(map(int, input().split()))
a = [int(x) for x in input().split()]
if sum(a) >= h:
    print('Yes')
else:
    print('No')

# Optimized solution
h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
if sum(a) >= h:
    print('Yes')
else:
    print('No')
# Original solution
import math
H,N = list(map(int,input().split()))
A = [int(x) for x in input().split()]

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


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


# Optimized solution
import math
H,N = list(map(int,input().split()))
A = [int(x) for x in input().split()]

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

else:
    print("No")
# Original solution
# -*- coding: utf-8 -*-
h, n = list(map(int,input().split())) 
a = [int(i) for i in input().split()]

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


# Optimized solution
# -*- coding: utf-8 -*-
h, n = list(map(int,input().split())) 
a = [int(i) for i in input().split()]

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

h -= sum(a)
if h <= 0:
    print("Yes")
else:
    print("No")
# Original solution
h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
at = 0

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


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

# Optimized solution
h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
at = sum(a)

if at >= h:
    print("Yes")
else:
    print("No")
# Original solution
h, n = list(map(int, input().split()))
a = [int(i) for i in input().split()]

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

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

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

print(('Yes' if sum(a) >= h else 'No'))
# Original solution
H, N = list(map(int, input().split()))
A = list(map(int, input().split()))
total = sum(A)
if H > total:
    ans = "No"
else:
    ans = "Yes"
print(ans)


# Optimized solution
H,N=list(map(int,input().split()))
atk = sum(map(int,input().split()))
if atk>=H:
  print("Yes")
else:
  print("No")
# Original solution
h,n=list(map(int,input().split()))
a=list(map(int,input().split()))
print(("Yes" if sum(a)>=h else "No"))

# Optimized solution
h,n=list(map(int,input().split()))
a=sum(map(int,input().split()))
print(("Yes" if a>=h else "No"))
# Original solution
# coding: utf-8
# Here your code !




def main(N,k):
    p = 0
    for i in range(N-1):
        p2 = p
        while p2-1-p2//k != p:
            p2+=1
        p=p2
    return p




if __name__ == '__main__':
    N,k=input().split()
    print((main(int(N),int(k))))

# Optimized solution
# coding: utf-8
# Here your code !

def main(N,k):
    p = 0
    p2 = 0
    memo = 0
    for i in range(N-1):
        p, p2 = p2, k*(p2+1)//(k-1) - 2
        while p2-1-p2//k != p:
            p2+=1
    return p2

if __name__ == '__main__':
    N,k=input().split()
    print((main(int(N),int(k))))
# Original solution
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

from collections import Counter

# 直径が分かる。中心からの距離が分かる。

N = int(eval(input()))
A = [int(x) for x in input().split()]

diag = max(A)

def solve_even():
    # 中心が1頂点
    depth = [x-diag//2 for x in A]
    if any(x < 0 for x in depth):
        return False
    counter = Counter(depth)
    if counter[0] != 1:
        return False
    for i in range(1,diag//2+1):
        if counter[i] < 2:
            return False
    return True

def solve_odd():
    # 直径の隣を深さ0と扱う
    depth = [x-(diag+1)//2 for x in A]
    if any(x < 0 for x in depth):
        return False
    counter = Counter(depth)
    if counter[0] != 2:
        return False
    for i in range((diag+1)//2):
        if counter[i] < 2:
            return False
    return True

bl = solve_odd() if diag&1 else solve_even()
answer = 'Possible' if bl else 'Impossible'
print(answer)

# Optimized solution
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

"""
・直径の長さをdとする。だいたい、半径より下の長さは存在できない
・だいたいd/2より上は任意に足せる。ただし中心は1組のみ
"""

N,*A = list(map(int,read().split()))

def test(A):
    D = max(A)
    r = (D+1)//2
    counter = [0] * (D+1)
    for x in A:
        counter[x] += 1
    if (D&1) and (counter[r] != 2):
        return False
    if (not (D&1)) and (counter[r] != 1):
        return False
    if any(x < r for x in A):
        return False
    if any(counter[x] <= 1 for x in range(r+1,D+1)):
        return False
    return True

answer = 'Possible' if test(A) else 'Impossible'

print(answer)
# Original solution
from collections import Counter, deque

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

cntA = Counter(A)
valA = list(set(A))
valA.sort(reverse=True)

pathLeng = [0] * (N + 1)

if cntA[valA[0]] < 2 or cntA[valA[-1]] > 2:
    print('Impossible')
    exit()

pathLeng[1] = valA[0]
pathLeng[2] = valA[0]
cntA[valA[0]] -= 2
maxNode = 2

pr = [[] for _ in range(N + 1)]
ch = [[] for _ in range(N + 1)]

for i, a in enumerate(valA[1:], start=2):
    if a == valA[-1] and cntA[valA[-1]] == 1:
        prevLeft = maxNode
        prevRight = maxNode - 1
        maxNode += 1
        ch[prevLeft].append(maxNode)
        ch[prevRight].append(maxNode)
        pr[maxNode].append(prevLeft)
        pr[maxNode].append(prevRight)
        pathLeng[maxNode] = valA[-1]
        cntA[valA[-1]] -= 1
        break

    prevLeft = (i - 1) * 2 - 1
    prevRight = (i - 1) * 2
    nowLeft = i * 2 - 1
    nowRight = i * 2

    maxNode = max(maxNode, nowRight)
    if maxNode > N:
        print('Impossible')
        exit()

    pathLeng[nowLeft] = a
    pathLeng[nowRight] = a

    cntA[a] -= 2

    ch[prevLeft].append(nowLeft)
    ch[prevRight].append(nowRight)
    pr[nowLeft].append(prevLeft)
    pr[nowRight].append(prevRight)
else:
    ch[maxNode].append(maxNode - 1)
    pr[maxNode - 1].append(maxNode)

for a, c in list(cntA.items()):
    for _ in range(c):
        maxNode += 1
        i = pathLeng.index(a)
        ch[maxNode].append(ch[i][0])
        pr[ch[i][0]].append(maxNode)
        pathLeng[maxNode] = a
        cntA[a] -= 1

def search(index):
    visited = [False] * (N + 1)
    visited[index] = True
    st = deque([(index, 0)])
    ret = 0

    while st:
        now, d = st.pop()
        ret = max(ret, d)

        for to in pr[now]:
            if not visited[to]:
                st.append((to, d + 1))
                visited[to] = True
        for to in ch[now]:
            if not visited[to]:
                st.append((to, d + 1))
                visited[to] = True
    return ret

for i, d in enumerate(pathLeng[1:], start=1):
    if search(i) != d:
        print('Impossible')
        exit()

for v in list(cntA.values()):
    if v != 0:
        print('Impossible')
        exit()

A.sort()
pathLeng.sort()

if A == pathLeng[1:]:
    print('Possible')
else:
    print('Impossible')

# Optimized solution
from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
cntA = Counter(A)
valA= list(set(A))
valA.sort()

if valA[-1] % 2 == 1:
    if valA[0] != -(-valA[-1] // 2) or cntA[valA[0]] != 2:
        print('Impossible')
        exit()

    for a in range(valA[0], valA[-1] + 1):
        if cntA[a] < 2:
            print('Impossible')
            exit()
else:
    if valA[0] != valA[-1] // 2 or cntA[valA[0]] != 1:
        print('Impossible')
        exit()

    for a in range(valA[0] + 1, valA[-1] + 1):
        if cntA[a] < 2:
            print('Impossible')
            exit()

print('Possible')