Harryxun/stf_run huggingface dataset:
h,n=map(int,input().split())
a=list(map(int, input().split()))
print('Yes' if h<=sum(a) else (No))

### FIXED CODE ###

h,n=map(int,input().split())
a=list(map(int, input().split()))
print('Yes' if h<=sum(a) else ('No'))
a, b, c = mapt(int, input().split())
if a + b >= c:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a, b, c = map(int, input().split())
if a + b >= c:
    print('Yes')
else:
    print('No')
from math import gcd
from functools import reduce

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

print(reduce(gcd,A))

### FIXED CODE ###

from functools import reduce

N=int(input())
A=list(map(int,input().split()))
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
print(reduce(gcd,A))
A=map(int,input().split)
if A[0]*A[1]==0:
  print('Even')
else:
  print('Odd')

### FIXED CODE ###

A=list(map(int, input().split()))
if A[0]*A[1]%2==0:
  print('Even')
else:
  print('Odd')
S=input()
Q=[s for s in S if s != 'A']
U=list('KIHBR')
import sys
if S.count('A')>4:
    print('NO')
    sys.exit()
for i in range(len(S)):
    if S[i] not in list('AKIHABARA'):
        print('NO')
        sys.exit()
for i in range(len(S)-1):
    if S[i]==S[i+1]:
        print('NO')
        sys.exit()
    elif S[i]=='K' and S[i+1]!='I':
        print('NO')
        sys.exit()
    elif S[i]=='I' and S[i+1]!='H':
        print('NO')
        sys.exit()
for i in range(len(Q)):
    if Q[i]==U[i]:
        pass
    else:
        print('NO')
        break
else:
    print('YES')

### FIXED CODE ###

S=input()
Q=[s for s in S if s != 'A']
U=list('KIHBR')
import sys
if S.count('A')>4:
    print('NO')
    sys.exit()
elif len(Q)!=5:
    print('NO')
    sys.exit()
for i in range(len(S)):
    if S[i] not in list('AKIHABARA'):
        print('NO')
        sys.exit()
for i in range(len(S)-1):
    if S[i]==S[i+1]:
        print('NO')
        sys.exit()
    elif S[i]=='K' and S[i+1]!='I':
        print('NO')
        sys.exit()
    elif S[i]=='I' and S[i+1]!='H':
        print('NO')
        sys.exit()
for i in range(len(U)):
    if Q[i]==U[i]:
        pass
    else:
        print('NO')
        break
else:
    print('YES')
import math
A,B,C,D=map(int,input().split())


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


#print(len([x for x in range(A,B) if x%2!=0 and x%3!=0]))

size=B-A+1
#C
C2=A%C
if C2 is 0:
    Csize=size
else:
    C2=C-C2
    Csize=size-C2

#D
D2=A%D
if D2 is 0:
    Dsize=size
else:
    D2=D-D2
    Dsize=size-D2

cd =lcm(C,D)

#c,dの最小公倍数
cd2=A%cd
if cd2 is 0:
    CDsize=size
else:
    cd2=cd-cd2
    CDsize=size-cd2

#Cの個数
Cq=Csize//C

#Dの個数
Dq=Dsize//D

#CDの個数
CDq=CDsize//cd

Q=size-(Cq+Dq)+CDq
Q=Q-1
print(Q)












"""
listsize=B-A-1
Q=0
for i in range(listsize+1):
    number=i+A
    if number % C is not 0 and number % D is not 0:
        Q+=1
print(Q)
"""




### FIXED CODE ###

from fractions import gcd
A,B,C,D=map(int,input().split())


def lcm(x, y):
    return (x * y) // gcd(x, y)

size=B

cd=lcm(C,D)
allC=size//C
allD=size//D
allcd=size//cd
ALL=size-(allC+allD-allcd)

size=A-1
cd=lcm(C,D)
pC=size//C
pD=size//D
pcd=size//cd
P=size-(pC+pD-pcd)

print(ALL-P)
x=int(input())
if x<1200:
    print(ABC)
else:
    print(ARC)

### FIXED CODE ###

x=int(input())
if x<1200:
    print("ABC")
else:
    print("ARC")
print(x**3)


### FIXED CODE ###

x=input()
print(x**3)
n = map(int, raw_input().split())
list_str = []
for count in range(0,n):
    list_str.append(raw_input())

for count in range(0,n-1):
    if count == 0:
        compare1 = set(list_str[count])
    else:
        compare1 = set(output)
    compare2 = set(list_str[count+1])
    output = list(compare1 & compare2)
output = ''.join(output)
print output

### FIXED CODE ###

a,b,c = map(int, raw_input().split())
if b-a == c-b:
	print "YES"
else:
	print "NO"
a,b=map(int,input())
print(sum(i==i[::-1] for i in map(str,range(a,b+1))))

### FIXED CODE ###

a,b=map(int,input().split())
print(sum(i==i[::-1] for i in map(str,range(a,b+1))))
import sys
# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
# import heapq
import decimal
# import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))

# ===CODE===

eps = 10 ** (-9)


def main():
    def popcounter(n):
        cnt = 0
        if n == 0:
            return 0
        for _ in range(INF):
            tmp = bin(n).count("1")
            n = n % tmp
            cnt += 1
            if n == 0:
                return cnt

    n = ni()
    x = input()
    x_1 = x.count("1")

    num = int(x, 2)
    num1 = num % (x_1 - 1)
    num0 = num % (x_1 + 1)

    ans = []
    for i in range(len(x)):
        if x[len(x) - 1 - i] == "1":
            tmp_n = (num1 - pow(2, i)) % (x_1 - 1)
        else:
            tmp_n = (num0 + pow(2, i)) % (x_1 + 1)
        ans.append(popcounter(tmp_n) + 1)

    l = len(ans)
    for i in range(l - 1, -1, -1):
        print(ans[i])


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
# import heapq
import decimal
# import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))

# ===CODE===

eps = 10 ** (-9)


def main():
    def popcounter(n):
        cnt = 0
        if n == 0:
            return 0
        for _ in range(INF):
            tmp = bin(n).count("1")
            n = n % tmp
            cnt += 1
            if n == 0:
                return cnt

    n = ni()
    x = sys.stdin.readline()
    x_1 = x.count("1")

    num = int(x, 2)
    num1 = num % (x_1 - 1) if x_1 - 1 > 0 else 0
    num0 = num % (x_1 + 1)

    ans = []
    for i in range(n):
        if x[n - 1 - i] == "1":
            if x_1 - 1 < 1:
                ans.append(0)
                continue
            else:
                tmp_n = (num1 - pow(2, i, x_1 - 1)) % (x_1 - 1)
        else:
            tmp_n = (num0 + pow(2, i, x_1 + 1)) % (x_1 + 1)
        ans.append(popcounter(tmp_n) + 1)

    l = len(ans)
    for i in range(l - 1, -1, -1):
        print(ans[i])


if __name__ == '__main__':
    main()
a = list(input())
b = list(input())
c = list(input())

n = a[0]
del a[0]
while True:
    if n == "a":
        n = a[0]
        del a[0]
        if len(a) == 0:
            print("A")
            break
    elif n == "b":
        n = b[0]
        del b[0]
        if len(b) == 0:
            print("B")
            break
    elif n == "c":
        n = c[0]
        del c[0]
        if len(c) == 0:
            print("C")
            break


### FIXED CODE ###

a = list(input())
b = list(input())
c = list(input())

n = a[0]
if len(a) < 1:
    del a[0]

while True:
    if n == "a":
        n = a[0]
        del a[0]
        if len(a) == 0:
            print("A")
            break
    elif n == "b":
        n = b[0]
        del b[0]
        if len(b) == 0:
            print("B")
            break
    elif n == "c":
        n = c[0]
        del c[0]
        if len(c) == 0:
            print("C")
            break
a,b=map(int,input().split());c,d=input().split("-");print("Yes"len(c)==a and len(d)==b else"No")

### FIXED CODE ###

a,b=map(int,input().split());s=input().split("-");ans="Yes"
if len(s)!=2:ans="No"
if len(s[0])!=a or len(s[1])!=b:ans="No"
if "--" in s:ans=="No"
print(ans)
n = int(input())
s = [int(input()) for _ in range(n)]
print(len(set(s)))

### FIXED CODE ###

n = int(input())
s = [input() for _ in range(n)]
print(len(set(s)))
k = input()
nana = int((len(k)-1)*'7')
ans = len(k)
k = int(k)
flag = False

def is_prime(q):
    q = abs(q)
    if q == 2:
        return True
    if q < 2 or q & 1 == 0:
        return False
    return pow(2, q-1, q) == 1


if is_prime(k):
    print(k-1)
else:
    for i in range(10000000):
        nana = (nana * 10) + 7
        if nana % k == 0:
            flag = True
            break
        ans += 1

    if flag:
        print(ans)
    else:
        print('-1')


### FIXED CODE ###


k = int(input())

if k % 2 == 0 or k % 5 == 0:
    print(-1)
else:
    n = 7
    cnt = 1
    for i in range(k):
        if n % k == 0:
            break
        cnt += 1
        n = (n * 10 + 7) % k
    print(cnt)
n = int(input())
l = list(map(int, input().split()))
l.sort()

ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        k = bisect_left(l, l[i] + l[j])
        ans += k - j - 1
print(ans)


### FIXED CODE ###

from bisect import bisect_left
 
n = int(input())
l = sorted(list(map(int,input().split())))

ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        k = bisect_left(l,l[i]+l[j])
        ans += k - j - 1

print(ans)
n,m = map(int, input().split())
room = [[] for i in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    room[a-1].append(b-1)
    room[b-1].append(a-1)
mark = [-1] * n
mark[0] = 0
q = []
q.append(0)

while len(q):
    now = q.pop(0)
    for i in room[now]:
        if mark[i] == -1:
            mark[i] = now
            q.append(i)

print("Yes")
for i in mark[1:]:
    print(i+1)


### FIXED CODE ###

n=int(input())
m=n%10
if m == 3:
    s = 'bon'
elif m == 0 or m == 1 or m == 6 or m == 8:
    s = 'pon'
else:
    s = 'hon'
print(s)
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[0]*k
for j in range(n-k+1):
  x=1  
  for i in range(j,j+k):
    x*=a[i]
  b[i-1]=x

for m in range(len(b)-1):
  if b[m]<b[m+1]:
    print("Yes")
  else:
    print("No")


### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n-k):
  if a[i]<a[i+k]:
    print('Yes')
  else:
    print('No')
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
from scipy.special import comb
K, S = map(int, input().split())
S = S if K * 3 / 2 - S > 0 else K * 3 - S
count = comb(S + 2, 2, exact=True)
print(str(count))


### FIXED CODE ###

#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
K, S = map(int, input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if z <= K and z >= 0:
            count += 1
print(str(count))
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

def main():
    h,w=map(int,input().split())
    a=[list(map(int,input().split())) for i in range(h)]
    b=[list(map(int,input().split())) for i in range(h)]

    ablst=[[0]*w for i in range(h)]
    ma=0
    for i in range(h):
        for j in range(w):
            ablst[i][j]=abs(a[i][j]-b[i][j])
            ma=max(ma,ablst[i][j])
    lst1=[0]*ma*(h+w+10)

    lst=[[lst1[:] for i in range(w)] for i in range(h)]
    lst[0][0][abs(a[0][0]-b[0][0])]=1


    # print(lst)
    for i in range(h):
        for j in range(w):
            if i+1<h:
                for k in range(len(lst[i][j])):
                    if lst[i][j][k]==1:
                        lst[i+1][j][k+ablst[i+1][j]]=1
                        lst[i+1][j][abs(k-ablst[i+1][j])]=1
            if j+1<w:
                for k in range(len(lst[i][j])):
                    if lst[i][j][k]==1:
                        lst[i][j+1][k+ablst[i][j+1]]=1
                        lst[i][j+1][abs(k-ablst[i][j+1])]=1
        # print(d)
            # print(lst[i][j])
    # anslst=list(lst[-1][-1].keys())
    # anslst.sort(key=lambda x: abs(x))
    # print(lst)
    for i in range(len(lst[-1][-1])):
        if lst[-1][-1][i]==1:
            print(i)
            break

main()

### FIXED CODE ###

import sys

input = sys.stdin.buffer.readline

h, w = map(int, input().split())
AA = [list(map(int, input().split())) for _ in range(h)]
BB = [list(map(int, input().split())) for _ in range(h)]

kouho = [[0] * (w) for _ in range(h)]
delta = abs(AA[0][0] - BB[0][0])
kouho[0][0] |= 1 << delta
for y in range(h):
    for x in range(w):
        nx = x + 1
        ny = y
        if nx < w:
            delta = abs(AA[ny][nx] - BB[ny][nx])
            temp = 0
            for i in range(1, delta + 1):
                if (kouho[y][x] >> i) % 2:
                    temp |= 1 << (delta - i)
            # print(x,y,kouho[y][x],temp,delta)
            kouho[ny][nx] |= kouho[y][x] << delta
            kouho[ny][nx] |= kouho[y][x] >> delta
            kouho[ny][nx] |= temp

        nx = x
        ny = y + 1
        if ny < h:
            delta = abs(AA[ny][nx] - BB[ny][nx])
            temp = 0
            for i in range(1, delta + 1):
                if (kouho[y][x] >> i) % 2:
                    temp |= 1 << (delta - i)
            # print(x,y,kouho[y][x],temp,delta)
            kouho[ny][nx] |= kouho[y][x] << delta
            kouho[ny][nx] |= kouho[y][x] >> delta
            kouho[ny][nx] |= temp
# print(kouho)
for i in range(81):
    if (kouho[h - 1][w - 1] >> i) % 2:
        print(i)
        exit()
x,y=map(int,input().split())

if x==0 and y==0:
 brake
print(sort(x,y))

### FIXED CODE ###

while True:
 x,y=sorted ([int(x) for x in input().split()])
 if (x,y)==(0,0):
  break
 print(x,y)
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A, B, C, D = (int(x) for x in input().split())

Cu = B//C       #Cの上限
Cd = -(-A//C)   #Cの下限
Du = B//D       #Dの上限
Dd = -(-A//D)   #Dの下限

#Least common multiple
LCMu = B//(lcm(C,D))
LCMd = -(-A//lcm(C,D))
print(lcm(C,D))

C_num = Cu - Cd + 1
D_num = Du - Dd + 1
LCM_num = LCMu - LCMd + 1

C_D_num = C_num + D_num - LCM_num
A_B_num = B - A  + 1

ans = A_B_num - C_D_num
print(ans)


### FIXED CODE ###

import fractions as math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A, B, C, D = (int(x) for x in input().split())

Cu = B//C       #Cの上限
Cd = -(-A//C)   #Cの下限
Du = B//D       #Dの上限
Dd = -(-A//D)   #Dの下限

#Least common multiple
LCMu = B//(lcm(C,D))
LCMd = -(-A//lcm(C,D))


C_num = Cu - Cd + 1
D_num = Du - Dd + 1
LCM_num = LCMu - LCMd + 1

C_D_num = C_num + D_num - LCM_num
A_B_num = B - A  + 1

ans = A_B_num - C_D_num
print(ans)
T=input()
res=''
for i in range(len(T)):
	if T[i]=='?':
		if  not i-1<0:
			if res[i-1]=='P':
				res+='D'
			else:
				if not i+1>=len(T):
					if T[i+1]=='P':
						res+='D'
					else:
						res+='P'
				else:
					res+='D'
		else:
			if T[i+1]=='D':
				res+='P'
			else:
				res+='D'
	else:
		res+=T[i]

print(res)


### FIXED CODE ###

T=input()
res=''
for i in range(len(T)):
	if T[i]=='?':
		if i==0:
			if len(T)==1:
				res+='D'
			else:
				if T[i+1]=='P':
					res+='D'
				else:
					res+='P'
		else:
			if i+1<len(T):
				if res[i-1]=='P' or T[i+1]=='P':
					res+='D'
				else:
					res+='P'
			else:
				res+='D'
	else:
		res+=T[i]
print(res)
s = input()
k = int(input())
s = list(reversed(s))
cnt =0
while cnt < k and s[-1] == '1':
  cnt +=1
  s.pop()

print(s[-1])

### FIXED CODE ###

s = input()
k = int(input())

ans = '1'
for i in range(k):
  if s[i] != '1':
    ans = s[i]
    break

print(ans)
import sys


def rec(i):
    #if(i==0):print(i,H[i])
    #if(i>=1):print(i,H[i],H[i-1])
    #if(i>=2):print(i,H[i],H[i-2])


    if(i==0): return 0

    res = float('inf')
    res = rec(i-1)+abs(H[i]-H[i-1])
    if(i==1): return res

    if(res > rec(i-2)+abs(H[i]-H[i-2])):
        res = rec(i-2)+abs(H[i]-H[i-2])

    return res

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


#print(N)
#print(H)

print(rec(N-1))

#7
#2 9 4 5 1 6 10


### FIXED CODE ###

import sys


N = int(input())

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

dp = [float('inf')]*N

dp[0] = 0
#print(N)
#print(H)
#print(dp)


for i in range(1,N):
    if(i==1):
        dp[1] = abs(H[1]-H[0])
    else:
        dp[i] = dp[i-1]+abs(H[i]-H[i-1])
        if(dp[i] > dp[i-2]+abs(H[i]-H[i-2])):
            dp[i] = dp[i-2]+abs(H[i]-H[i-2])
        #
        #print(i,dp)

print(dp[-1])

#7
#2 9 4 5 1 6 10
move = [[[10, 10], [4, 4]], [[8, 2],[4, 2]]]

MAX_N = 10000000+1
sos = [1] * (MAX_N+1)
sos[0] = sos[1] = 0
for i in range(2, int(MAX_N**0.5)+1):
    if sos[i]:
        for j in range(i+i, MAX_N+1, i):
            sos[j] = 0

while 1:
    n = int(input())

    if not n: break
    n -= (n%2 == 0)
    while n >= 13:
        if sos[n] and sos[n-2] and sos[n-6] and sos[n-8]:
            print(n)
            break
        else:
            n -= move[sos[n-8]][sos[n-6]][sos[n-2]]
# measure_stop = datetime.now()
# print(measure_stop - measure_start)

### FIXED CODE ###

# from datetime import datetime

# measure_start = datetime.now()
move = [[[10, 10], [4, 4]], [[8, 2],[4, 2]]]

MAX_N = 10000000+1
sos = [1] * (MAX_N+1)
sos[0] = sos[1] = 0
for i in range(2, int(MAX_N**0.5)+1):
    if sos[i]:
        for j in range(i+i, MAX_N+1, i):
            sos[j] = 0

while 1:
    try:
        n = int(input())

        if not n: break
        n -= (n%2 == 0)
        while n >= 13:
            if sos[n] and sos[n-2] and sos[n-6] and sos[n-8]:
                print(n)
                break
            else:
                n -= move[sos[n-8]][sos[n-6]][sos[n-2]]
    # measure_stop = datetime.now()
    # print(measure_stop - measure_start)
    except:
        pass
N = int(input())
A = [int(i) for i in input().split()]
A = set(A)
 
min1 = min(A)
A.remove(min1)
min2 = min(A)
if len(A) == 1:
  print(A.pop())
  exit()
 
is_all_even = True
 
for x in A:
  if x % 2 == 1:
    is_all_even = False
    break
    
if is_all_even or min2 % min1 == 0:
  print(min(A))
else:
  print(1)

### FIXED CODE ###

import fractions
N = int(input())
A = [int(i) for i in input().split()]
gcd = A[0]
for i in range(N-1):
  gcd = fractions.gcd(gcd, A[i+1])
  
print(gcd)
h,w=map(int,input().split())
s=[list(input()) for i in range(h)]
flag=True
count=0
for i in range(h):
  if flag==False:
    break
  for j in range(w):
    if s[i][j]=="#":
      if i>0 and s[i-1][j]!="#":
        flag=False
      elif i>0 and s[i-1][j]=="#":
        flag2=True
        
      if i<(h-1) and s[i+1][j]!="#":
        flag=False
      elif i<(h-1) and s[i+1][j]=="#":
        flag2=True
        
      if j>0 and s[i][j-1]!="#":
        flag=False
      elif j>0 and s[i][j-1]=="#":
        flag2=True
        
      if j<(w-1) and s[i][j+1]!="#":
        flag=False
      elif j<(w-1) and s[i][j+1]=="#":
        flag2=True
      if flag2:
        flag=True
    else:
      count+=1
        
if h==1 and w==1:
  if s[0][0]=="#":
    flag=False
    
if count==(h*w):
  flag=True
  
if flag:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

h,w=map(int,input().split())
s=[list(input()) for i in range(h)]
flag=True
count=0
for i in range(h):
  if flag==False:
    break
  for j in range(w):
    if flag==False:
      break
    flag2=False
    if s[i][j]=="#":
      if i>0 and s[i-1][j]!="#":
        flag=False
      elif i>0 and s[i-1][j]=="#":
        flag2=True
        
      if i<(h-1) and s[i+1][j]!="#":
        flag=False
      elif i<(h-1) and s[i+1][j]=="#":
        flag2=True
        
      if j>0 and s[i][j-1]!="#":
        flag=False
      elif j>0 and s[i][j-1]=="#":
        flag2=True
      
      if j<(w-1) and s[i][j+1]!="#":
        flag=False
      elif j<(w-1) and s[i][j+1]=="#":
        flag2=True
      if flag2:
        flag=True
    else:
      count+=1
        
if h==1 and w==1:
  if s[0][0]=="#":
    flag=False
    
if count==(h*w):
  flag=True
  
if flag:
  print("Yes")
else:
  print("No")
N, K = map(int, input().split(' '))
if 2N < K:
    return N
else:
    a = N // K
    return min(abs(N - a * K), abs(N - a * (K + 1)))

### FIXED CODE ###

N, K = map(int, input().split(' '))
if 2 * N < K:
    print(N)
else:
    a = N // K
    mm = min(abs(N - a * K), abs(N - (a + 1) * K))
    print(mm)
import sys
def input():
    return sys.stdin.readline()[:-1]

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

A = [None]*N
B = [None]*N
for i in range(N):
    a,b = list(map(int, input().split()))
    A[i] = a
    B[i] = b

INF = float('inf')
dp = [INF]*(H+1)
dp[H] = 0

for i in raneg(N):
    a = A[i]
    b = B[i]
    for j in range(H,0,-1):
        aft = j - a
        if aft<=0:
            dp[0] = min(dp[0],dp[j]+b)
        else:
            dp[aft] = min(dp[aft],dp[j]+b)
print(dp[0])

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]

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

A = [None]*N
B = [None]*N
for i in range(N):
    a,b = list(map(int, input().split()))
    A[i] = a
    B[i] = b

INF = float('inf')
dp = [INF]*(H+1)
dp[H] = 0

for i in range(N):
    a = A[i]
    b = B[i]
    for j in range(H,0,-1):
        aft = j - a
        if aft<=0:
            dp[0] = min(dp[0],dp[j]+b)
        else:
            dp[aft] = min(dp[aft],dp[j]+b)
print(dp[0])
n=int(input())
x=input()
s=list(x)
 
list=[]
for i in range(n):
    a=0
    l=s[:i]
    a+=l.count("W")
    k=s[i+1:]
    a+=k.count("E")
    list.append(a)
 
f=min(list)

print(f)

### FIXED CODE ###

a, b= map(int, input().split())
 
c=a+b
d=a-b
e=a*b
 
f=max([c, d, e])
 
print(f)
N, M = map(int, input().split())
heights = list(map(int, input().split()))
 
good = [True] * N
for m in range(0, M):
  A, B = map(int, input().split())
  if heights[A - 1] > heights[B - 1]:
    good[B] = False
  elif heights[A - 1] < heights[B - 1]:
    good[A] = False
    
count = 0
for obs in good:
  if obs: count += 1
    
print(count)


### FIXED CODE ###

N, M = map(int, input().split())
heights = list(map(int, input().split()))
 
greatest = [0] * N
for m in range(0, M):
  A, B = [int(s)-1 for s in input().split()]
  greatest[A] = max(greatest[A], heights[B])
  greatest[B] = max(greatest[B], heights[A])
    
count = 0
for i in range(0, N):
    count += heights[i] > greatest[i]
    
print(count)
import math

n, x = map(int, input().split())
xl = list(map(int, input().split()))
l = []

for i in xl:
    l.append(abs(i - x))

ans = l[0]

for i in l:
    ans = math.gcd(ans, i)

print(ans)

### FIXED CODE ###

import fractions

n, x = map(int, input().split())
xl = list(map(int, input().split()))
l = []

for i in xl:
    l.append(abs(i - x))

ans = l[0]

for i in l:
    ans = fractions.gcd(ans, i)

print(ans)
n, x = map(int, input().split())
l_array = [int(x) for x in input().split()]
d = 0
cnt = 0
while d <= x:
    d = d + l_array[cnt]
    cnt += 1
print(cnt)

### FIXED CODE ###

n, x = map(int, input().split())
l_array = [int(x) for x in input().split()]
cnt = 1
now = 0
for l in l_array:
    now += l
    if now > x:
        break
    cnt += 1
print(cnt)
d, t, s = list(map(int, input()))
if (s * t >= d):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

d, t, s = list(map(int, input().split(' ')))
if (s * t >= d):
  print('Yes')
else:
  print('No')