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())
A = list(map(int, input().split()))
total_vote = sum(A)
selectable = total_vote / (4 * M)
A.sort(reverse = True)
count = 0

for i in range(N):
    if A[i] >= selectable :
        count += 1
        if count == M:
            print('Yes')
            break;

    else:
        print('No')
        break;

Solution (Python):

import sys
n, m = map(int, input().split())
a = list(map(int, input().split()))
vote = sum(a)
rank = sorted(a, reverse=True)
border = vote / (4*m)

count = 0

for i in range(0, n):
    if rank[i] >= border:
        count += 1

    if count == m:
        print('Yes')
        sys.exit()

print('No')

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

for i in range(n):
	total=total+a[i]
th=total/(4*m)


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

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

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

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

a.sort(reverse = True)
s = sum(a)

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

Solution (Python):
def main():
    I = [int(_) for _ in input().split()]
    N = I[0]
    M = I[1]
    A = [int(_) for _ in input().split()]

    least = sum(A) / (4 * M)
    count = 0
    for i in A:
        if i >= least:
            count += 1

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



if __name__ == "__main__":
    main()

Solution (Python):
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
import sys,bisect,string,math,time,functools,random
def Golf():*a,=map(int,open(0))
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[];g=[[] for i in range(n)]
    for i in range(E):
        inp=LI();org_inp.append(inp)
        if index==0:inp[0]-=1;inp[1]-=1
        if len(inp)==2:
            a,b=inp;g[a].append(b)
            if not Directed:g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp;aa=(inp[0],inp[2]);bb=(inp[1],inp[2]);g[a].append(bb)
            if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,boundary=1,search=[],replacement_of_found='.',mp_def={'

    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def bit_combination(k,n=2):return [[tb//(n**bt)%n for bt in range(k)] for tb in range(n**k)]
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)
def show2d(g,h,w):
    for i in range(h):show(g[i*w:i*w+w])

YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase

input=lambda: sys.stdin.readline().rstrip()

def ran_input():
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

show_flg=False
show_flg=True

ans=0



n,m=LI()
a=sorted(LI())

if a[-m]<sum(a)/(4*m):
    ans='No'
else:
    ans='Yes'
    
print(ans)

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
total = 0
flag = 0
ans = []
for a in A:
    total += a
to = total / (4 * M)
sort_A = sorted(A)
length = len(sort_A)
for i in range(M):
    ans.append(sort_A[length - i - 1])
for ans_sub in ans:
    if ans_sub < to:
        flag += 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")

Solution (Python):


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


A = sorted(A)[::-1]
total = sum(A)
thre = total * (1 / (4*M))
if A[M-1] < thre:
    print('No')
else:
    print('Yes')

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

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


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

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

Solution (Python):
N, M = (int(x) for x in input().split())
array = list(map(int, input().strip().split()))
list.sort(array, reverse = True)
sum = 0
for i in range(N):
  sum += array[i]
if array[M-1] * 4 * M >= sum:
  print('Yes')
else:
  print('No')

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

lmt = sum(A) /(4*m)
A.sort(reverse=True)
if A[m-1] >= lmt:
  print('Yes')
else:
  print('No')

Solution (Python):


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

threshold = sum(As) / (4*M)

popular = sorted(As, reverse=True)[:M]

if all(A >= threshold for A in popular):
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
items = sum(a)
b = items * (1/(4*m))
popular = sorted(a, reverse=True)
popular_item = 0
for i in popular:
    if i >= b:
        popular_item += 1
if popular_item >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
def solve(n, m, arr):
    arr.sort()
    for i in range(m):
        if arr[-1 - i] < sum(arr) * (1 / (4 * m)):
            return False
    return True

if __name__ == "__main__":
    n, m = map(int, input().split(' '))
    arr = [int(s) for s in list(input().split())]
    if solve(n, m, arr):
        print('Yes')
    else:
        print('No')

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: int, M: int, A: "List[int]"):
    A.sort(reverse=True)
    a=sum(A)
    count=0
    for i in range(M):
        if A[i]>=a/(4*M):
            count+=1
    if count<M:
        print(NO)
    else:
        print(YES)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    M = int(next(tokens))  
    A = [int(next(tokens)) for _ in range(N)]  
    solve(N, M, A)

if __name__ == '__main__':
    main()

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

Solution (Python):
n,m = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
thresh = sum(A)/float(4*m)

tmp = [a for a in A if a >= thresh]

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

Solution (Python):

import sys





YES = "Yes"  
NO = "No"  


def solve(N: int, M: int, A: "List[int]"):
    A=sorted(A,reverse=True)
    sa=sum(A)
    if N==1:
        print(YES)
    else:
        print(YES if sa/(4*M)<=A[M-1] else NO)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    M = int(next(tokens))  
    A = [int(next(tokens)) for _ in range(N)]  
    solve(N, M, A)

if __name__ == '__main__':
    main()

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

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)
ans = []
a.sort()
ans = a[-m:]
for i in ans:
    if float(i) < total / (4 * m):
        print("No")
        exit(0)
print("Yes")

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

Solution (Python):
import numpy as np
n, m = map(int, input().split(" "))
arr = list(map(int, input().split(" ")))
arr = np.array(arr)

s = np.sum(arr)
choosable = len(np.where(4*m*arr >= s)[0])
if m > choosable:
    print('No')
else:
    print('Yes')

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

for i in range(m):
    if(a[i]< total_vote*(1/(4*m))):
        ischoose = False
    

if(ischoose == False):
    print("No")
else:
    print("Yes")

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

Solution (Python):
nm = input().split(" ")
N, M = int(nm[0]), int(nm[1])


sorted_data = sorted(list(map(int, input().split(" "))), reverse=True)

if sorted_data[M - 1] * 4 * M >= sum(sorted_data):
  print("Yes")
else:
  print("No")

Solution (Python):
import numpy as np

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

An=np.array(A)
S=sum(A)/(4*M)

X=np.count_nonzero(An >= S)

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

Solution (Python):
def main():
    n, m = map(int, input().split())
    ary = sorted(list(map(int, input().split())), reverse=True)
    if ary[m-1] >= sum(ary) / (4*m):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

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

a.sort(reverse=True)
S = sum(a)

if not a[M-1] < (S/4/M):
    print("Yes")
else:
    print("No")

Solution (Python):
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
n_votes = sum(A)
print('Yes' if sum(map(lambda x: 4 * M * x >= n_votes, A)) >= M
            else 'No')

Solution (Python):
N, M = map(int, input().split())
A = [int(i) for i in input().split()]
total = sum(A)

ans = sum([1 for a in A if a>=total/(4*M)])
print('Yes' if ans >=M else 'No')

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

  counter = 0

  for i in range(M):
    if A[i]*4*M >= sum(A):
      counter+=1
    else:
      pass

  if counter == M:
    print('Yes')
  else:
    print('No')


if __name__ == "__main__":
  main()

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

for i in range(n):
  if a[i]>=asum/(4*m):
    pop = pop+1
    if pop == m:
      break
if pop==m:
  print('Yes')
else:
  print('No')

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = 1 / (4 * m) * sum(a)
ans = []
for i in a:
  if i >= b:
    ans.append(ans)
if len(ans) >= m:
  print('Yes')
else:
  print('No')

Solution (Python):
inputLine=input()
N=int(inputLine.split(" ")[0])
M=int(inputLine.split(" ")[1])


inputLine=input()
A=inputLine.split(" ")
for i in range(len(A)):
    A[i]=int(A[i])


popularProductCount = 0
for i in range(len(A)):
    if A[i] >= sum(A) / (4*M):
        popularProductCount += 1



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

Solution (Python):
def LI():
	return [ int(s) for s in input().split() ]
N,M = LI()
A = LI()
sum_A = sum(A)
 
print('Yes') if sum(map(lambda x: x >= sum_A*(1/4/M), A)) >= M else print('No')

Solution (Python):
nums = list(map(int, input().split()))
n = nums[0]
m = nums[1]

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

sum = 0
for v in a:
  sum += v

result = []
for s in a:
    if s >= sum * (1 / (4 * m)):
        result.append(s)
if len(result) >= m:
    print("Yes")
else:
    print("No")

Solution (Python):


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


a = sorted(a, reverse=True)
sum = sum(a)

for i in range(m):
  if a[i] < (sum / (4 * m)): 
    print("No")
    exit()

print("Yes")

Solution (Python):


import sys
import math

from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint

INF = float('inf')

ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
sys.setrecursionlimit(1000000000)


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



n,m = mis()
alist = lmis()

alist.sort()
alist.reverse()

min = sum(alist) * float(1/(4*m))

for i in range(m):
    if alist[i] < min:
        print('No')
        exit(0)

print('Yes')

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

Solution (Python):
N, M = [int(e) for e in input().split()]
A = [int(e) for e in input().split()]
count = 0
sum = 0

for a in A:
    sum += a

for a in A:
    if 4 * M * a >= sum:
        count += 1

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

Solution (Python):
n, m = map(int, input().split())
populars = list(map(int, input().split()))
populars.sort(reverse=True)

flag = "Yes"
for i, item in enumerate(populars):
    if item < sum(populars)*(1/(4*m)):
        flag = "No"
    if i >= m-1 : break
print(flag)

Solution (Python):


n, m = [0] * 2
a = []

def format_input(filename = None):
	global n, m
	global a
	if filename == None:
		n, m = list(map(int, input().split()))
		a = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		n = rng(1, 10**2)
		m = rng(1, n)
		a = [rng(1, 10**3) for i in range(n)]
		print(n, m)
		print(' '.join(list(map(str, a))))

def get_answer():
	sorted_a = sorted(a)
	if sorted_a[-m] > (sum(a) - 1) // (4 * m):
		answer = 'Yes'
	else:
		answer = 'No'
	return answer

if __name__ == '__main__':
	format_input()

	ans = get_answer()
	print(ans)

Solution (Python):
N, M = [int(element) for element in input().split(" ")]
AList = [int(element) for element in sorted(input().split(" "), key=int)]
AList = AList[::-1]

count = 0
s = sum(AList) / (4 * M)

text = "Yes"

for n in range(M):
    if AList[n] < s:
        text = "No"
        break
    
print(text)

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

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

total = sum(A)

th = total/(4*m)
A = sorted(A,reverse=True)

ans = 'Yes'
for i in range(m):
  if A[i] >= th:
    continue
  else:
    ans = 'No'
  

print(ans)

Solution (Python):
NM = input().split()
A = input().split()
N = int(NM[0])
M = int(NM[1])
for j in range(N):
    A[j] = int(A[j])
A.sort(reverse=True)
for i in range(M):
    if int(A[i]) < sum(A)/4/M:
        print("No")
        exit()
print("Yes")

Solution (Python):



N,M= map(int, input().split())
A = list(map(int, input().split())) 
sumA=sum(A)
numM = sum(x>=(sumA*0.25/M) for x in A)
if numM>=M:
    ans='Yes'
else:
    ans='No'

print(ans)

Solution (Python):
"""
N M
A1 ... AN
この中から人気商品 M 個を選びます。ただし、得票数が総投票数の 1/4M 未満であるような商品は選べません。
人気商品 M 個を選べるなら Yes、選べないなら No を出力してください。
"""
n,m=map(int,input().split())
a=list(map(int,input().split()))


b=sorted(a, reverse=True)




if b[m-1]>= (sum(b) /(4*m)) :
  print("Yes")
else:
  print("No")
  

"""
x,y,z=map(int,input().split())
a,b,c=x,y,z
a,b=b,a
a,c=c,a
print(a,b,c)
"""

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

S = sum(a)
cond = S / 4 / m
Buy = True

for i in range(m):
    if a[i] < cond:
        Buy = False
        break

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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: int, M: int, A: "List[int]"):
    A.sort(reverse=True)
    a=sum(A)
    count=0
    for i in range(M):
        if A[i]>=a/(4*M):
            count+=1
    if count<M:
        print(NO)
    else:
        print(YES)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    M = int(next(tokens))  
    A = [int(next(tokens)) for _ in range(N)]  
    solve(N, M, A)

if __name__ == '__main__':
    main()

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("Yes")
else:
    print("No")

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

Solution (Python):




if(__name__ == '__main__'):
    
    n, m = map(int, input().split(" "))
    a_arr = list(map(int, input().split(" ")))
 
    sum = 0
    for a in a_arr:
        sum += a
    threshold = sum / (4*m)
 
    a_arr.sort()
 
    if a_arr[n-m] < threshold:
        print("No")
    else:
        print("Yes")

Solution (Python):

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


total = 0
for num in a:
    total += num

pjn =  1/(4*m)
x = total * pjn
count = 0
for each_n in a:
    if each_n < x:
        continue;
    else:
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
list2=[]
a,b=map(int,input().split())
if a>=b:
    k=0
    c=list(map(int,input().split()))
    for i in c:
        k=k+i
    for j in c:
        if j>=(k)/(4*b):
            list2.append(j)
    g=len(list2)
    if b <= g:
        print("Yes")
    else:
        print("No")

Solution (Python):
i=0
j=0
N,M = map(int, input().split())
a=sorted(list(map(int,input().split())),reverse=True)
for i in range(M):
    if a[0+i]>=sum(a)/4/M:
        j+=1
if j==M:
    print("Yes")
else:
    print("No")

Solution (Python):
def printYN(c): print("Yes") if c else print("No")


n, m = [int(w) for w in input().split()]
a = [int(w) for w in input().split()]
total = sum(a)

choice = [t for t in a if t >= total / (4 * m)]


printYN(len(choice) >= m)

Solution (Python):
import numpy as np
N,M = list(map(int,input().split()))
A= np.array(list(map(int,input().split())))
limit = A.sum()/4/M

over = np.where(A >= limit)[0]

ans = over.size

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

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


a.sort(reverse=True)
limit = 1/(m*4) * sum(a)

flag = 0

for i in range(m):
    if a[i] >= limit:
        flag += 1
    else:
        flag = -1
        break
if flag == m:
    print('Yes')
else:
    print('No')

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



"""
n = 
m = 
a = votes for product 1 >= i >= n
"""

minimum_vote = sum(a) / (4 * m)


eligible = list(filter(lambda x: x >= minimum_vote, a))


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

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

limit = sum(a) / (4 * m)
count = 0
for i in a:
    if i >= limit:
        count += 1

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

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

A = [int(i) for i in input().split()]

A_sum = 0
for i in A:
    A_sum += i

A.sort(reverse = True)

YN = True
for i in range(M):
    if A[i] < A_sum / (4 * M):
        YN = False
        break

if YN == True:
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
sort = sorted(a, reverse=True)
sum = sum(sort)
count = 0
for i in range(m):
    if sort[i] < float(sum / (4 * m)):
        count += 1
    else:
        continue
if count == 0:
    print("Yes")
else:
    print("No")

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

Solution (Python):
n,m = map(int, input().split())
A = [int(i) for i in input().split()]
B = []

for i in A:
    if i >= sum(A)/(4*m):
        B.append(i)

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

Solution (Python):
import numpy as np
import math
import scipy as sp
import queue
import collections

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

def main(kwargs):
    n = kwargs["n"]
    m = kwargs["m"]
    A = kwargs["A"]

    sumA = sum(A)
    count = 0
    res = "No"

    for i in range(n):
        if A[i] * 4 * m >= sumA:
            count += 1

        if count == m:
            res = "Yes"

    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    
    
    
    kwargs["n"], kwargs["m"] = [int(i) for i in cin]
    cin = input().split()
    kwargs["A"] = [int(i) for i in cin]

    cout = main(kwargs)
    print(cout)

Solution (Python):
N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
list.sort(A,reverse=True)
count = 0
Sum = sum(A)
for i in range(M):
    if A[i] >= Sum/(4*M):
        count +=1

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

Solution (Python):
"""
NTC here
"""
import sys
inp = sys.stdin.readline
def input(): return inp().strip()




 
def iin(): return int(input())
 
 
def lin(): return list(map(int, input().split()))
 
 


 
def main():
    T = 1
    while T:
        T-=1
        n, m = lin()
        a = lin()
        sm = sum(a)
        ch = 0
        lst = sm/(4*m)
        for i in a:
            if i>=lst:
                ch+=1
        print('Yes' if ch>=m else 'No')

 
 
 
 
 
main()

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

t = sum(A)
ans = 0
for a in A:
    if a * 4 * M >= t:
        ans += 1
if ans >= M:
    print("Yes")
else:
    print("No")

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

S=0

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

if S>=M:
    print("Yes")

else:
    print("No")

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

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

list.sort(A,reverse=True)

sumnum = sum(A)
if A[M-1] >= (sumnum/(4*M)):
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
X = list(map(int, input().split()))
A = list(map(int, input().split()))
N = X[0]
M = X[1]
O = 0
for i in range(N):
  if A[i] >= sum(A) / (4 * M):
    O += 1

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

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

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


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


if __name__ == '__main__':
    b, c = map(int, input().split())

    a = [int(i) for i in input().split()]
    t = sum(a)
    a.sort(reverse=True)
    count = 0
    for i in range(c):
        if a[i] / t >= 1 / (4 * c):
            count += 1
    if count == c:
        print("Yes")
    else:
        print("No")

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
sum = sum(A)
flag = 0
A = sorted(A, reverse=True)


for i in range(0, M):
  if M == 0:
    break
  if A[i]<(sum/(4*M)):
    print('No')
    flag = 1
    break

if flag == 0:
  print("Yes")

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

Solution (Python):


t = input().split()
n = int(t[0])
m = int(t[1])

a = sorted(map(int, input().split()))

s = sum(a)

if a[n-m] < s/(4*m):
    print("No")
else:
    print("Yes")

Solution (Python):
N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A.sort()
A.reverse()
total = 0
Flag = True
for i in A:
    total += i
for i in range(M):
    if A[i]*4*M < total:
        Flag = False
if Flag:
    print("Yes")
else:
    print("No")

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

"1 2 3 4 5を配列に"
A = list(map(int, input().split()))
s = sum(A)
ok = s * (1/(4*M))
count = 0

for a in A:
  if a >= ok:
    count += 1

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

Solution (Python):


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

for i in a:
    if i >= sum(a) / (4 * m):
        l.append(i)

if len(l) >= 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)/4/m
if a[m-1]<b:
    print('No')
else:
    print('Yes')

Solution (Python):
in1 = input().split()
in1num = [int(x) for x in in1]
a = input().split()
anum = [int(x) for x in a]
sum_a = sum(anum)
anum.sort(reverse=True)

N = in1num[0]
M = in1num[1]





if anum[M-1] >= (sum_a)/(4*M):
  print("Yes")
else:
  print("No")

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    N, M = map(int, input().rstrip().split())
    As = list(map(int, input().rstrip().split()))
    bound = sum(As) / (4 * M)
    res = 0
    for a in As:
        if a >= bound:
            res += 1
    if res >= M:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

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

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

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

a = input().split()
for i in range(len(a)):
    a[i] = int(a[i])
tot = sum(a)
a = sorted(a, reverse=True)
count = 0
for j in range(len(a)):
    max = a[0]
    if max < tot / 4 / m:
        break
    count += 1
    a.pop(0)

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

Solution (Python):
import bisect
n,m = [int(i) for i in input().split()]
al = sorted([int(i) for i in input().split()],reverse = True)
total = sum(al)

l = al[:m]

if l[-1] >= total/(4*m):
    print('Yes')
else:
    print('No')

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
A.reverse()
B = sum(A) / (4 * M)
C  = [A[j] for j in range(M) if A[j] >= B]
print('Yes' if len(C) == M else 'No')

Solution (Python):



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

votes = sum(lst)
threshold = votes * (1/(4*M))

lst = sorted(lst,reverse=True)

index = M-1
if(lst[index] >= threshold):
  print('Yes')
else:
  print('No')

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

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
s = sum(A)
min = s / (4 * M)
cnt = 0
for a in A:
  if a >= min:
    cnt += 1
if M <= cnt:
  print('Yes')
else:
  print('No')

Solution (Python):
n, m = map(int,input().split())
A = sorted([i for i in map(int,input().split())])
total = sum(A)
if A[-m] >= total/4/m:
    print('Yes')
else:
    print('No')

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

Solution (Python):

N, M = map(int, input().split())
count = 0
nums = [int(x.strip()) for x in input().split(' ')]
num_sum = sum(nums)
tmp = num_sum / (4*M)

for num in nums:
  if not num < 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()))

su=sum(A)
i=0
while max(A)*4*M>=su:
    i+=1
    A.remove(max(A))
    if i>=M:
        print("Yes")
        break
else:
    print("No")

Solution (Python):

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

N = a[0]
M = a[1]
 
b=list(map(int,input().split()))

Sum_vote = sum(b)
list.sort(b, reverse=True)

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

Solution (Python):
N, M = map(int, input().split())
shina = list(map(int, input().split()))
shina.sort(reverse=True)
hantei = 0
sou = sum(shina)

for i in range(M):
  if shina[i] < sou / (4 * M):
    hantei += 1

if hantei == 0:
  print('Yes')
else:
  print('No')

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

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

A = sorted(list( map(int, input().split()) ), reverse=True)	

ans="Yes"
if A[m-1]*4*m < sum(A): ans="No"

print(ans)

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

a = sorted(a, reverse = True)
if a[m-1] >= sum(a) / (4*m):
  ans = "Yes"
else:
  ans = "No"
print(ans)

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

count = 0
x = 4 * M
v = sum(B) / x

for i in B:
    if i >= v:
        count += 1

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

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

t = math.ceil(sum(a)/(4*m))
ans = 0
for i in a:
  if t <= i:
    ans += 1
    
if m <= ans:
  print("Yes")
else:
  print("No")