Problem:
 Score : 200 points    Problem Statement We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print Yes ; otherwise, print No .      Constraints  1 \leq M \leq N \leq 100  1 \leq A_i \leq 1000  A_i are distinct.  All values in input are integers.         Input Input is given from Standard Input in the following format:  N  M  A_1  ...  A_N       Output If M popular items can be selected, print Yes ; otherwise, print No .        Sample Input 1 4 1
5 4 2 1      Sample Output 1 Yes  There were 12 votes in total. The most popular item received 5 votes, and we can select it.       Sample Input 2 3 2
380 19 1      Sample Output 2 No  There were 400 votes in total. The second and third most popular items received less than \dfrac{1}{4\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.       Sample Input 3 12 3
4 56 78 901 2 345 67 890 123 45 6 789      Sample Output 3 Yes

Solution (Python):
N, M = map(int, input().split())
AList=list(map(int, input().split()))
ALists=sorted(AList,reverse=True)
tot=sum(AList)
for i in range(M):
    if(ALists[i]*1.0/tot<1.0/(4.0*M)):
        print('No')
        i-=1
        break
if(i==M-1):
    print('Yes')

Solution (Python):
s = input().split()
n = int(s[0])
m = int(s[1])
alist = list(map(int, input().split()))
a_sum = sum(alist)
alist.sort(reverse=True)
std = a_sum/(4*m)
if (alist[m-1]<std):
  print("No")
else:
  print("Yes")

Solution (Python):
n, m= map(int, (input().split()))
a = list(map(int, input().split()))
count = 0
total = 0
for i in a:
  total += i
for j in a:
  if not (j / total < 1 / (4 * m)):
    count += 1
if count >= m:
  print("Yes")
else:
  print("No")

Solution (Python):
n, m = input().split(" ")
n = int(n)
m = int(m)

votes = input().split(" ")
votes = [int(vote) for vote in votes]
votes.sort(reverse=True)

check_vote = votes[m-1]

if check_vote >= sum(votes) / (4*m):
    print("Yes")
else:
    print("No")

Solution (Python):
N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
S=S/(4*M)
A.sort(reverse=True)
if A[M-1]>=S:
  print('Yes')
else:
  print('No')

Solution (Python):
n,m = map(int,input().split())
l = list(map(int,input().split()))
sl = sum(l) * (1 / (4 * m))
ok = 0

for i in range(len(l)):
  if l[i] >= sl:
    ok += 1
if ok >= m:
  print('Yes')
else:
  print('No')

Solution (Python):
N,M = map(int, input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
b = sum(A)
if A[M-1]<b/(4*M):
  print('No')
else:
  print('Yes')

Solution (Python):
import sys

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

nM=0
As=sorted(A, reverse=True)
threshold=float(sum(A)/(4*M))


last=A[0]

for i in range(N):
    if not(float(As[i]) < threshold):
        nM+=1
    else:
        break
    
    if nM>=M:
        break


if nM>=M:
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = map(int, input().split())
votes = list(map(int, input().split()))
total_votes = sum(votes)
border = total_votes / (4 * m)

count = 0
for a in votes:
    if a < border:
        continue
    count += 1

if count >= m:
    print('Yes')
else:
    print('No')

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

Solution (Python):
N, M = map(int, input().split(' '))
A = list(map(int, input().split(' ')))

totalVote = 0
for a in A:
    totalVote += a

boader = totalVote / (4*M)

countPopularItem = 0
for a in A:
    if a >= boader:
        countPopularItem += 1

if countPopularItem >= M:
    print('Yes')
else:
    print('No')

Solution (Python):
N, M = map(int, input().split())

As = list(map(int,input().split()))
vote_sum = sum(As)
least_vote_num = vote_sum / (4 * M)

if len([A for A in As if A >= least_vote_num]) >= M:
    print('Yes')
else:
    print('No')

Solution (Python):
n, m = input().split()
m = int(m)
s = 0
r = 'Yes'
v = [ int(x) for x in input().split(' ') if x != ' ']
v.sort(reverse=True)
for i in v:
  s += i
s = s / 4 / m
for i in range(m):
  if v[i] < s:
    r = 'No'
    break
    
print(r)

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

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

ksum= sum(k)
k.sort(reverse=True)

p = 'Yes'
for i in range(b):
    
    if k[i] < ksum/4/b:
        p = 'No'
        break
print(p)

Solution (Python):
n, m = map(int, input().split())
List = list(map(int, input().split()))

list_sum = sum(List)

count = 0
for i in List:
    if i * 4 * m >= list_sum:
        count += 1

if count >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
N,M=map(int,input().split())
A=list(map(int,input().split()))
k=1/(4*M)
t=0
S=0
for i in range(N):
  S=S+A[i]
for i in range(N):
  if A[i]>=S*k:
    t=t+1
  else:
    continue
if t>=M:
  print ('Yes')
else:
  print ('No')

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)
c = 0
for i in a:
  if i >= total/(4*m):
    c += 1
if c >= m:
  print("Yes")
else:
  print("No")

Solution (Python):
[N,M] = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
l.sort()
ans = 0
for i in range(N):
    ans += l[i]

if l[N-M] >= ans/(4*M):
    print('Yes')
else:
    print('No')

Solution (Python):
def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    total = sum(a)
    must = total / (4 * m)
    cnt = 0
    for i in a:
        if i >= must:
            cnt += 1
            if cnt == m:
                print("Yes")
                exit()
    print("No")


if __name__ == '__main__':
    main()

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))

SUM = sum(A)
count = 0
for a in A:
    if a >= SUM / (4*M):
        count += 1
    
    if M == count:
        print("Yes")
        exit()

print("No")

Solution (Python):

import numpy as np
n,m=map(int,input().split())
a=list(np.fromstring(input(),int,sep=' '))
a.sort(reverse=True)
if a[m-1]<sum(a)/(4*m):
    print("No")
else:
    print("Yes")

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

n = a[0]
m = a[1]
co = 0
for i in range(n):
  if b[i]>=sum(b)/(4*m):
    co = co+1
if co >= m:
  print("Yes")
else:
  print("No")

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))

A.sort(reverse=True)
x = sum(A)
min_ = x / (4*M)
flag = 0

for i, a in enumerate(A):
  if a < min_:
    break
  if i+1 == M:
    flag = 1
    break
if flag == 1:
  print("Yes")
else:
  print("No")

Solution (Python):
import numpy as np

n,m = list(map(int, input().split()))
a = np.array(list(map(int, input().split())))
b=np.sum(a)
a_sort=np.sort(a)[::-1]
if a_sort[m-1]<b/(4*m):
  print("No")
else:
  print("Yes")

Solution (Python):
N,M=map(int,input().split())
A=list(map(int,input().split()))
S=0
for i in range(N):
	S=S+A[i]
min=S/(4*M)
count=0
for i in range(N):
	if A[i]>=min:
		count=count+1
if count>=M:
	print("Yes")
else:
	print("No")

Solution (Python):
N, M= list(map(int, input().split()))
A = list(map(int, input().split()))
total = sum(A)
if len([i for i in A if i >= total/(4*M)])>= M:
    print("Yes")
else:
    print("No")

Solution (Python):
import math
n, m = map(int, input().split(" "))
aL = list(map(int, input().split(" ")))

sm = sum(aL)

cnt = 0
for a in aL:
    if sm * (1 / (4 * m)) <= a:
        cnt += 1
    if m <= cnt:
        print("Yes")
        exit()

print("No")

Solution (Python):
import sys
n,m = map(int,input().split())
l = sorted(list(map(int,input().split())),reverse=True)
for i in range(m):
    if l[i] < sum(l) * 1/(4*m):
        print('No')
        sys.exit()
print('Yes')

Solution (Python):
n,m = map(int,input().split()) 
a = list(map(int,input().split()))
sum_list = sum(a)

count = 0
for i in range(n):
    if a[i] >= sum_list/(4 * m):
        count +=1

if count >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))

x = 0

A = sorted(A, reverse=True)

for i in A:    
    x += i

if A[M-1] >= x*float(1/(4*M)):
    print('Yes')
else:
    print('No')

Solution (Python):
N, M = map(int, input().split())
As = sorted(list(map(int, input().split())), reverse=True)

if As[M-1] < (sum(As) / (4*M)):
    print("No")
else:
    print("Yes")

Solution (Python):
N,M = map(int, input().split())
list = list(map(int, input().split()))

num = 0

for i in list:
    if i >= sum(list)/(4*M):
        num+=1

if num >= M:
    print('Yes')
else:
    print('No')

Solution (Python):
def main():
    mylist = []
    for i in range(2):
        mylist.append(input())
    N, M = list(map(int, mylist[0].split()))
    votes = list(map(int, mylist[1].split()))

    v_sum = sum(votes)

    votes.sort(reverse=True)

    flag = True
    for i in range(M):
        if votes[i] < v_sum / (4 * M):
            flag = False

    if flag:
        print("Yes")
    else:
        print("No")    



if __name__ == "__main__":
    main()

Solution (Python):
N, M = map(int,input().split())
AA = list(map(int,input().split()))
AA.sort()
SUM = sum(AA)
TH = SUM/4/M
if AA[-M]>=TH:
  print('Yes')
else:
  print('No')

Solution (Python):
N,M = map(int, input().split())
A = list(map(int, input().split()))

count = 0
votes = sum(A)

for a in A:
	if a/votes >= 1/(4*M):
		count += 1

if count >= M:
	print('Yes')
else:
	print('No')

Solution (Python):
import math
n,m= map(int,input().split(' '))
arr= list(map(int,input().split(' ')))

votes= sum(arr)
lim=math.ceil(votes/(4*m))
m_arr= [i for i in arr if i>= lim]
if len(m_arr)>=m:
    print('Yes')
else:
    print('No')

Solution (Python):
def listint():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a
n,m = listint()
votes = listint()
sumvo = sum(votes)
able = 0
for i in range(n):
    if votes[i] >= sumvo/(4*m):
        able = able+1
if able >= m:
    print('Yes')
else:
    print('No')

Solution (Python):

N,M=map(int,input().split())
A=[int(i) for i in input().split()]
SUM=sum(A)
cnt=0
for a in A:
    if 4*M*a>=SUM:
        cnt+=1
if cnt>=M:
    print('Yes')
else:
    print('No')

Solution (Python):
n,m=map(int,input().split())
a=list(map(int, input().split()))
num=sum(a)
tmp=float(num)/float(4.0*m)
count=0
for i in range(n):
  if a[i]>=tmp:
    count+=1
if count>=m:
  print("Yes")
else:
  print("No")

Solution (Python):

N, M = map(int, input().split())
A = list(map(int, input().split()))
total = sum(A)
limit = total / (4 * M)

count = 0
for a in A:
    count += (a >= limit)

if count >= M:
    print("Yes")
else:
    print("No")

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
print("Yes" if A[M-1] * 4 * M >= sum(A) else "No")

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
rr = range


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols
    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])
    return ret


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_map_as_int(H):
    '''
    
    '''
    ret = []
    for _ in range(H):
        ret.append([1 if s == '
        
        
    return ret


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  
from fractions import gcd


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


N, M = read_ints()
A = read_ints()

thre = sum(A) / (4 * M)
cnt = 0
for a in A:
    if a >= thre:
        cnt += 1
print('Yes' if cnt >= M else 'No')

Solution (Python):
import math

N,M=map(int,input().split(" "))
A=[int(_) for _ in input().split(" ")]

s = math.ceil(sum(A) / (4*M))


count = 0

for i in range(N):
  if A[i] >= s:
    count += 1

if M <= count:
  ans="Yes"
else:
  ans="No"
  
print(ans)

Solution (Python):
N,M = list(map(lambda x:int(x),input().split()))
A_list = list(map(lambda x:int(x),input().split()))
A_total = 0
can_be_choosen = 0

for n in A_list:
    A_total += n

for n in range(len(A_list)):
    if not (float(A_list[n]) < (A_total*(1.0/(4.0 * M)))):
        can_be_choosen += 1

if can_be_choosen >= M:
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
l.reverse()
a = sum(l)
for i in range(m):
  if l[i]/a < 1/(4*m):
    print('No')
    exit()
print('Yes')

Solution (Python):
NM = list(map(int, input().split()))
N = NM[0]
M = NM[1]
vote = list(map(int, input().split()))
vote.sort()
voteSum = 0
for j in vote:
    voteSum += j
if vote[-M]/voteSum >= 1/(4*M):
    print('Yes')
else:
    print('No')

Solution (Python):
N, M = map(int, input().split())
l = input().split()
l = [int(i) for i in l]  
l.sort(reverse=True)
val = sum(l)
deadline = val/(4*M)
if l[M-1] >= deadline:
  print("Yes")
else:
  print("No")

Solution (Python):
def main():
    N, M = map(int, input().split())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    A_list.sort(reverse = True)

    value_sum = float(sum(A_list))
    fourM = float(4 * M)
    i_cycle = 0
    for Ai in A_list :
        i_cycle = i_cycle + 1
        
        if Ai / value_sum >= (1 / fourM) and i_cycle <= M :
            if i_cycle == M :
                print("Yes")
                break
        
        
        
        else :
            print("No")
            break

if __name__ == '__main__':
    main()

Solution (Python):

n,m= map(int,input().split())
a = list(map(int,input().split()))[:n]

s = sum(a)
t = s * (1/(4*m))

r=0

for i in range(n):
    if a[i] >= t :r+=1


if r >= m:
    print('Yes')
else:print('No')

Solution (Python):


N, M = list(map(int, input().split()))
arr = list(map(int, input().split()))

border = sum(arr) / (4*M)

count = 0
for arr_i in arr:
    if(arr_i >= border):
        count+=1

if(count >= M):
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
N,M = map(int, input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
a_sum = sum(a)
for i in range(M):
    if(a[i] < a_sum/(4*M)):
        print("No")
        sys.exit()
print("Yes")

Solution (Python):
N,M = map(int, input().split())
a   = list(map(int, input().split()))

count = 0

for i in range(N):
    bool_over = a[i] >= (sum(a)/(4*M))
    if(bool_over):
        count +=1

if(M <= count):
    print('Yes')
else:
    print('No')

Solution (Python):
n, m = map(int, input().split())
a = input().split()

max = 0
for ai in a:
  max += int(ai)

ss = max / (4 * m)

rs = 0
for ai in a:
  if float(ai) >= ss:
  	rs += 1

if rs >= m:
  print('Yes')
else:
  print('No')

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
votes = sum(a)
a.sort(reverse=True)
ans = 'Yes'
for i in range(m):
    if a[i] < votes / (4 * m):
        ans = 'No'
        break
print(ans)

Solution (Python):
def main():
    n,m = list(map(int,input().strip().split()))
    a = list(map(int,input().strip().split()))

    total = sum(a)
    boarder = (1/(4*m)) * total
    chosen = 0

    for i in range(len(a)):
        if(a[i]>=boarder):
            chosen = chosen + 1

    if(chosen<m):
        print('No')
    else:
        print('Yes')

main()

Solution (Python):
n, m = map(int, (input().split()))
a = list(map(int, input().split()))
total = sum(a)
count = 0
for i in a:
    if i >= total * (1/(4*m)):
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
n , m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
a = a[::-1]
pop = []
counter = 0
for i in range(m):
    pop.append(a[i])

all_vote = 0
for i in a:
    all_vote += i

for n in pop:
    if n*4*m < all_vote:
        print("No")
        break
    else:
        counter += 1

if counter == m:
    print("Yes")

Solution (Python):
n, m = map(int, input().split())
x = [int(i) for i in input().split(maxsplit=(n-1))]

sum = 0
count = 0
for i in x:
    sum += i

con = (1/(4*m))*sum

for i in x:
    if i >= con:
        count += 1
    if count == m:
        print('Yes')
        exit()
print('No')

Solution (Python):
n,m=input().split()
a = [int(e) for e in input().split()]
a.sort()
a.reverse()

if a[int(m)-1] *4*int(m) < sum(a)  :
  print('No')
else:
  print('Yes')

Solution (Python):
N, M = input().split()
A_lst = input().split()
total = sum([int(i) for i in A_lst])
th = total/(4*int(M))
count = sum([int(i) >= th for i in A_lst])
if count >= int(M):
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = map(int, input().split())
l = list(map(int, input().split()))
s = sum(l)
c = 0
p = 0
for el in l:
    if el >= (s/(m*4)):
        c = c + 1
    if c == m:
        p = 1
        break

if p == 1:
    print('Yes')
else:
    print('No')

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
x = sum(a) / (4 * m)
c = 0
for i in range(n):
  if a[i] >= x:
    c += 1
  if c >= m:
    print('Yes')
    break
if c < m:
  print('No')

Solution (Python):
N,M = map(int, input().split(' '))
a = list(map(int, input().split(' ')))

a = list(filter(lambda x: x>=sum(a)/(4.0*M),a))
if len(a) >= M:
  print("Yes")
else:
  print("No")

Solution (Python):
n, m = map(int, input().split())
a = input().split()
a = [int(_) for _ in a]

total_amount = sum(a)
threshold = 1/(4*m) * total_amount
clear_a = [_ for _ in a if _ >= threshold]
if len(clear_a) >= m:
  print('Yes')
else:
  print('No')

Solution (Python):
n, m = map(int, input().split())
a = input().split()
a = [int(i) for i in a]
s = sum(a)
dif = (1 / (4*m)) * s
cont = 0
for i in a:
     cont += (1 if i >= dif else 0)
print ('Yes' if cont >= m else 'No')

Solution (Python):
n, m = map(int, input().split())
x = [int(i) for i in input().split(maxsplit=(n-1))]

sum = 0
count = 0
for i in x:
    sum += i

con = (1/(4*m))*sum

for i in x:
    if i >= con:
        count += 1
    if count == m:
        print('Yes')
        exit()
print('No')

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
A_sorted = sorted(A)
A_all = sum(A)
if A_sorted[N-M] >= A_all/(4*M):
    print("Yes")
else:
    print("No")

Solution (Python):


n, m = map(int, input().split())

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

border = sum(a_list) / (4 * m)

a_choiced_list = [a for a in a_list if a >= border]

if len(a_choiced_list) < m:
    print('No')
else:
    print('Yes')

Solution (Python):
n,m = map(int,input().split())
a = list(map(int,input().split()))

sum_a = sum(a)
jouken = sum_a / (m * 4)

c = 0
for i in range(n):
    if a[i] >= jouken:
        c += 1
if c >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = list(map(int, input().split(" ")))
a_list = list(map(int, input().split(" ")))
a_sum = sum(a_list)
criteria = (1 / (4 * m)) * a_sum
a_list.sort()
a_list.reverse()
def check(a_list, m):
  for a in a_list:
    if a < criteria:
      return False
    m -= 1
    if m == 0:
      return True
result = check(a_list, m)
if result:
  print("Yes")
else:
  print("No")

Solution (Python):
N,M=map(int, input().split())
A = list(map(int, input().split()))
count =0
s = sum(A)
m = s/(4*M)
for i in range(N):
  if A[i] >= m:
    count += 1
if count >= M:
  print("Yes")
else:
  print("No")

Solution (Python):
N, M = map(int,input().split())
A = sorted(list(map(int,input().split())), reverse=True)
threshold = sum(A) / (4 * M)

if A[M - 1] < threshold:
  print("No")
else:
  print("Yes")

Solution (Python):
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
kijun = sum(A)/(4*M)
cnt = 0

for x in A:
    if x >= kijun:
        cnt+=1

if cnt >= M:
    print('Yes')
else:
    print('No')

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
g = (sum(A) / (4*M))
count = 0
for i in range(N):
    if A[i] >= g:
        count += 1
if count >= M:
    print("Yes")
else:
    print("No")

Solution (Python):



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

sum_v = sum(num_list)

thresh = sum_v/(4*num)
cnt = 0
for n in num_list:
    if n >= thresh:
        cnt = cnt+1

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

Solution (Python):
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()))

N,M=nm()
A=nl()
A.sort()
A.reverse()
th=sum(A)/M/4
flag=True
for i in range(M):
    if(A[i]<th):
        flag=False

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

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
x=0
for i in range(n):
    if a[i]>=sum(a)*(1/(4*m)):
        x+=1
if x>=m:
    print("Yes")
else:
    print("No")

Solution (Python):
import numpy as np

def main():
    n, m = map(int,input().split())
    a = list(map(int,input().split()))
    lim = np.sum(a)/(4*m)
    k=0
    for i in a:
        if i>=lim:
            k+=1
    if k>=m:
        print("Yes")
    else:
        print("No")
if __name__ == '__main__':
    main()

Solution (Python):

N,M = map(int,input().split())
A = list(map(int,input().split()))
newlist = sorted(A, reverse=True)
if newlist[M-1] < sum(newlist)/(4*M):
    print('No')
else:
    print('Yes')

Solution (Python):
def get():
    return list(map(int, input().split()))


a = get()
b = get()
count = 0
ball = sum(b) / (4 * a[1])
for i in b:
    if i >= ball:
        count += 1
if count >= a[1]:
    print("Yes")
else:
    print("No")

Solution (Python):
N, M = map(int, input().split())
list = list(map(int, input().split()))

i=0
s=0

while(i<N):
  s+=list[i]
  i+=1

m=s/(4*M)

list.sort(reverse=True)

r="Yes"
j=0

while(j<M):
  if(list[j]<m):
    r="No"
  j+=1
print(r)

Solution (Python):
N, M = map(int, input().split(' '))
A = [int(a) for a in input().split(' ')]
S = sum(A)
thre = S / (4 * M)

cnt = 0
for a in A:
    if a >= thre:
        cnt += 1

if cnt >= M:
    print("Yes")
else:
    print("No")

Solution (Python):
n,m = map(int,input().split())
a = list(map(int,input().split()))
s = sum(a)
count = 0
for i in a:
  if i >= s/(4*m):
    count+=1
if count >= m:
  print("Yes")
else:
  print("No")

Solution (Python):
n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
a.reverse()
s = sum(a)
flag = True

for i,j in enumerate(a):
    if i+1 > m:
        break
    if j < s/(4*m):
        flag = False
        break
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
N, M = map(int, input().split())
A = list(map(int,input().split()))
total = (1/(4*M)) * sum(A)
if A[M-1] >= total:
    print("Yes")
else:
    for i in range(M,N):
        if A[i] >= total:
            print("Yes")
            exit()
    print("No")

Solution (Python):
n,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
if a[m-1] < sum(a)/(4*m):
  print('No')
else:
  print('Yes')

Solution (Python):

n, m = tuple(map(int, input().split()))
nums = list(map(int, input().split()))
sorted_votes = sorted(nums, reverse=True)
if sorted_votes[m-1] < sum(nums)/(4*m):
    print('No')
else:
    print('Yes')

Solution (Python):
n, m = map(int,input().split())
a = list(map(int,input().split()))

total = sum(a)
threshold = total / 4 / m

num_over = 0
done = False
for i in a:
    if i >= threshold:
        num_over = num_over + 1
    if num_over == m:
        print('Yes')
        done = True
        break

if not done:
    print('No')

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))

flg = 0

b = sorted(a, reverse=True)

for i in range(m):
    x = sum(b) / (4 * m)
    if b[i] < x:
        flg = 1
    
if flg == 1:
    print("No")
else:
    print("Yes")

Solution (Python):
n,m = map(int,input().split(' '))
aa = list(map(int, input().split(' ')))
A = sorted(aa, reverse=True)
Am = A[:m]
for a in Am:
    if a>=(0.25/m)*sum(aa): continue
    else:
         print('No')
         exit(0)
print('Yes')

Solution (Python):
n,m = map(int,input().split())
l = sorted([int(x) for x in input().split()], reverse=True)
t = sum(l) / (4*m)
for a in range(m):
	if(l[a] < t):
		print('No')
		exit()
print('Yes')

Solution (Python):
n,m=map(int,input().split())
List=list(map(int,input().split()))
count=0
total=0
for i in List:
    total=total+i

for i in List:
    if i>=total/m/4:
        count=count+1
    else:
        count=count+0

if count>=m:
    print("Yes")
else:
    print("No")

Solution (Python):
N,M = map(int,input().split())
list_N = list(map(int,input().split()))

count = 0

get = sum(list_N)/(4*M)

for i in range(N):
    if list_N[i] >= get:
        count += 1

if count >= M:
    print("Yes")
else:
    print("No")

Solution (Python):
from fractions import Fraction
n, m = map(int,input().split())

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

s = sum(li)

pm = Fraction(1, 4*m)
sp = float(pm)

ans = []
for i in range(n):
    if (s * sp) <= li[i]:
        ans.append(li[i])
        
if (len(ans)>= m):
    print('Yes')
else:
    print('No')

Solution (Python):
n, m = list(map(int, input().split()))
nums = list(map(int, input().split()))
f = 4 * m
for n in nums:
    if n >= sum(nums) / f:
        m -= 1
    if m == 0:
        break
print('Yes'if m == 0 else 'No')

Solution (Python):


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

th = 1.0 * sum(A) / (4 * M)

sorted_A = sorted(A, key=lambda x: -x)
if sorted_A[M - 1] < th:
    print("No")
else:
    print("Yes")

Solution (Python):
N, M = input().split()
A_lst = input().split()
total = sum([int(i) for i in A_lst])
th = total/(4*int(M))
count = sum([int(i) >= th for i in A_lst])
if count >= int(M):
    print("Yes")
else:
    print("No")

Solution (Python):
N,M=map(int, input().split()) 
A = list(map(int, input().split()))
A.sort(reverse=True)
count = 0
sumA = 0
for i in range(len(A)):
    sumA += A[i]
for i in range(len(A)):
    if A[i] >= sumA*(1/(4*M)):
        count += 1
if count >= M:
    print("Yes")
else:
    print("No")

Solution (Python):
N,M = map(int,input().split())
Ai = list(map(int,input().split()))
Ai.sort(reverse=True)

tot = sum(Ai)
thre = tot/(4*M)

flag = 1
for i in range(M):
  if(Ai[i]<thre):
    flag=0
    break;

if(flag):
  print('Yes')
else:
  print('No')

Solution (Python):

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

result = True
sum = 0
a.sort(reverse=True)

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

threshould = sum / 4 / m

for i in range(m):

    if a[i] < threshould:
        result = False
if result:
    print("Yes")
else:
    print("No")

Solution (Python):
line = input().split(" ")
syurui = int(line[0])
itemCnt = int(line[1])

line2 = input().split(" ")
line2 = list(map(int,line2))
line2.sort(reverse=True)
okFlg = True;

for i in range(itemCnt):
  if line2[i] < 1 / (4 * itemCnt) * sum(line2):
    okFlg = False;
  
if okFlg:
  print("Yes")
else:
  print("No")

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,m = mi()
a = li()

stl = sum(a) / (4*m)
cnt = 0
for i in a:
    if i >= stl:
        cnt+=1
if cnt >= m:
    print('Yes')
else:
    print('No')

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))

B = A[:M]
sumA = sum(A)
check = 4*M
checkA=0
A = sorted(A ,reverse=True)

i = 0
while i<len(B):
    if A[i]>= (sumA/check):
        checkA+=0
    else:
        checkA+=1
    
    i+=1

if checkA==0:
    print("Yes")
else:
    print("No")

Solution (Python):
from math import ceil
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
val = sum(l)
f = 1
for i in range(m):
  if l[i] < ceil(val/(4*m)):
    f = 0
    break
if f:
  print("Yes")
else:
    print("No")

Solution (Python):
n, m = map(int, input().split())
l = sorted(list(map(int, input().split())))
l.reverse()
border = sum(l)/(4*m)
ans = 'Yes'
for i in range(m):
    if l[i] < border:
        ans = 'No'
print(ans)

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
S1 = sorted(A,reverse=True)
S2 = S1[0:M]
sum = sum(A)
ans = 'Yes'
for i in range(1,M+1):
    if S2[-1*i] >= sum/(4*M):
        continue
    else:
        ans = 'No'
        break
print(ans)

Solution (Python):
n, m = map(int, input().split())

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

total = sum(line)

sikii = total / 4 /m

cnt = 0


for i in line:
    if i >= sikii:
        cnt += 1
    

if cnt >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
N,M= map(int, input().split())

A = [int(i) for i in input().split()]
B = [0]*N

for i in range(N):
	if A[i] >= sum(A)/(4*M):
		B[i] = 1

if sum(B) >= M:
	print("Yes")
else:
	print("No")

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
c=0
for i in range(len(A)):
 c+=A[i]
d=c/4/M
e=0
for i in range(len(A)):
 if A[i]>=d:
  e+=1
if e>=M:
 print("Yes")
else:
 print("No")

Solution (Python):
N,M=map(int,input().split())
A=list(map(int,input().split()))
ans='No'
sum=0
b=1/(4*M)
c=0
for i in range(N):
  c+=A[i]
d=c*b
for i in range(N):
  if d<=A[i]:
    sum=sum+1
  if sum==M:
    ans='Yes'
print(ans)

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))

ans = 'No'
cnt = 0
b = sum(a)/(4*m)
for i in range(n):
  if a[i] >= b:
    cnt +=1
    if cnt >= m:
      ans = 'Yes'
      break
  
print(ans)

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians

from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N, M = MAP()
    A = LIST()

    W = sum(A)
    A = sorted(A, reverse=True)

    for i in range(M):
        if A[i] < W / (4*M):
            print("No")
            sys.exit()

    print("Yes")


if __name__ == '__main__':
    main()

Solution (Python):
N_M = list(map(int, input().split()))
items = list(map(int, input().split()))
total = sum(items)
match_items = []
for item in items:
    if item >= (total/4 / N_M[1]):
        match_items.append(item)
print('Yes') if N_M[1] <= len(match_items) else print('No')