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):
from sys import stdin
import math


data = stdin.readline().rstrip().split()
N, M = int(data[0]), int(data[1])

str_data = stdin.readline().rstrip().split()
int_data = [int(i) for i in str_data]

int_data = sorted(int_data, reverse=True)
sum_data = sum(int_data)
thr = sum_data / (4 * M)

flag = True
for i in range(M):
    if int_data[i] < thr:
        flag = False

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

Solution (Python):
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
F = m.split(' ')
X = []
 
for item in F:
  votes = int(item)
  X.append(votes)

S = sum(X)
C = (S/(4*M))
X.sort(reverse=True)
if X[M-1]<C:
  print("No")
else:
  print("Yes")

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

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

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

counter = 0

for i in an:
  if i >= sum(an)/(4*m):
    counter += 1
    
if counter >= m:
  print('Yes')
else:
  print('No')

Solution (Python):
n, m = 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):
N,M=map(int,input().split())
A=list(map(int,input().split()))

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

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

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *

























def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

inf = float('inf')
mod = 1000000007




def main():
	N,M = inputMap()
	A = inputList()

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

	ans = 0
	toto = toto * (1/(4*M))
	for i in A:
		if i < toto:
			pass
		else:
			ans += 1

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





def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res


def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y



def H(n, r, mod=10**9+7):
	
	
    return combination(n+r-1, r, mod)

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        
        
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

if __name__ == "__main__":
	main()

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

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

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

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

Solution (Python):

import numpy as np

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

a = np.array(input().split(), dtype='int')

sum_a = np.sum(a)

b = np.sort(a)[::-1]

if b[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()))
new_A= sorted(A,reverse=True)
if(new_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()))
A.sort(reverse=True)
S = sum(A)
cnt = 0
for i in range(M):
    if (A[i] < S/(4*M)):
        cnt += 1
if (cnt>=1):
    print("No")
else:
    print("Yes")

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


if __name__ == "__main__":
    main()

Solution (Python):
n, m= input().split()
n, m= int(n), int(m)
eq=0
soma=0
cont=0
lista=[]
for x in input().split():
	x= int(x)
	lista.append(x)
	soma+=x

eq= soma/(4*m)
for x in range(n):
	if lista[x] >= eq:
		cont+=1

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

Solution (Python):
def solve():
    n,m = map(int,input().split())
    a = tuple(map(int,input().split()))
    s = sum(a)
    level = (s+4*m-1)//(4*m)
    cnt = 0
    for i in a:
        if i>=level:
            cnt+=1
    if cnt>=m:
        print('Yes')
    else:
        print('No')
if __name__=='__main__':
    solve()

Solution (Python):
a=input().split(" ")
n=int(a[0])
m=int(a[1])
b=input().split(" ")
num=[]
total=0
for i in range(n):
    num.append(int(b[i]))
    total+=int(b[i])
num=sorted(num,reverse=True)

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

Solution (Python):

DATA = """
12 3
4 56 78 901 2 345 67 890 123 45 6 789
""".split("\n")

def get_debug_line():
	for i in DATA:
		yield i

if 1:
	get_line = input
else:
	get_line = get_debug_line().__next__
	get_line()

N, M = [int(i) for i in get_line().strip().split(" ")]
A = [int(i) for i in get_line().strip().split(" ")]
total = sum(A) / (4 * M)

count = 0
for v in A:
	if v >= total:
		count += 1

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

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

Solution (Python):


import numpy as np
N, M = map(int, input().split())
A = list(map(int, input().split()))

A = np.array(A)

num = np.sum(A >= np.sum(A)/(4*M))

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

Solution (Python):
n, m = 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):
N, M = map(int, input().split())
A = [int(n) for n in input().split()]
A.sort(reverse=True)
total = 0
for x in A:
    total += x
if A[M - 1] / total >= 1 / 4 / M:
    print("Yes")
else:
    print("No")

Solution (Python):
N,M=map(int,input().split())
C=input().split()
A=[int(a) for a in C]
whole=sum(A)
B=[a for a in A if a>=whole/4/M]
if len(B)>=M:
    print("Yes")
else:
    print("No")

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

border = sum(a)/(4*m)
c = 0

for ai in a:
    if ai >= border:
        c += 1

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

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

def linput():
    return [int(x) for x in input().split()]

n, m = linput()
a = linput()

cnt = 0

for i in a:
    if sum(a) <= 4*m*i:
        cnt += 1

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

Solution (Python):
n,m=map(int,input().split())
L=sorted(list(map(int,input().split())),reverse=True)
print('Yes' if all([L[i]*m*4>=sum(L) for i in range(m)]) else 'No')

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

Solution (Python):
n,m = map(int, input().split(' ')) 
lis= [int(x) for x in input().split(' ')]
limit=sum(lis)/(4*m)
result = list(filter(lambda x: x >=limit, lis) )
if(len(result)>=m):
    print("Yes")
else:
    print("No")

Solution (Python):
n, m= map(int, input().split())
List = [int(i) for i in input().split()]
num = 0
i = 0
L_sum = sum(List)
while i < len(List):
    if List[i] >= (1/(4*m))*L_sum:
        num += 1
    i += 1
if num >= m:
    print('Yes')
else:
    print('No')

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

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

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

Solution (Python):

N, M = map(int, input().split())
votes = list(map(int, input().split()))
total = sum(votes)
limit = total / (4 * M)
votes.sort(reverse=True)
count = 0
for i in votes:
    if i >= limit:
        count += 1
    else:
        break

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

Solution (Python):

N, M = map(int, input().split())
votes = list(map(int, input().split()))
total = sum(votes)
limit = total / (4 * M)
count = 0
for i in votes:
    if i >= limit:
        count += 1

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

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

Solution (Python):
n,m=[int(_) for _ in input().split()]
a=[int(_) for _ in input().split()]
a.sort(reverse=True)
s=sum(a)
c=0
for i in a:
    if i >= s/(4*m): c+=1
print("Yes" if c>=m else "No")

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

Solution (Python):
a,b = map(int,input().split())
c = list(map(int,input().split()))
sum = 0
for i in c:
  sum = sum + i
vote = (1/(4*b))*sum
count = 0
for j in c:
  if j>=vote:
    count = count + 1

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

Solution (Python):
n,m=map(int,input().split())
ax = list(map(int,input().split()))
allnum = sum(ax)
ax=[a for a in ax if a >= allnum/(4*m)]

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

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

count = 0
S = sum(A)

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

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

else:
    print("No")

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

asum = sum(a)
cnt = 0
for it in a:
    if not (it < asum/(4*m)): cnt += 1

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

Solution (Python):

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

B = sorted(list(A),reverse = True)

S = int(sum(B))
if B[M-1]>= S/(4*M):
    print('Yes')
else :
    print('No')

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

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

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

Solution (Python):
n, m = list(map(int, input().rstrip().split()))
al = list(map(int, input().rstrip().split()))
al.sort(reverse=True)
total = sum(al)
least = total * (1 / (4 * m))
result = 'Yes'
for i in range(m):
    if al[i] < least:
        result = 'No'
        break

print(result)

Solution (Python):
num = []
vote = []
num = list(map(int,input().split()))
vote = list(map(int,input().split()))
N = num[0]
M = num[1]
j = sum(vote)/(4*M)


cnt = 0
for i in vote:
    if  i>=j:
        cnt += 1
    else:
        pass

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

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

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

a.sort()
a.reverse()

suma = sum(a)

for i in range(m):
    if a[i] < suma / (4 * m):
        print('No')
        break
else:
    print('Yes')

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

Solution (Python):
n, m = map(int, input().split())
a_list = list(map(int, input().split()))
a_list.sort(reverse=True)
sum = 0
for i in a_list:
    sum+=i
index = 0
while index<m:
    if a_list[index]<(sum/(4*m)):
        print("No")
        exit()
    index+=1
print("Yes")

Solution (Python):
import sys
 
nm=input().split()
a=input().split()
n=int(nm[0])
m=int(nm[1])
lista=[]
for i in a:
  lista.append(int(i))
count=0
suma=sum(lista)
thre=suma/4/m
for i in lista:
  if i >= thre:
    count+=1
  if count >= m:
    print('Yes')
    sys.exit()
print('No')

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

count=0
nsum=sum(fam)

for x in fam:
    if x>=nsum/(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(reverse = True)

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

Solution (Python):
def main():
    n, m  = [int(x) for x in input().split(" ")]

    arr = [int(x) for x in input().split(" ")]

    sum = 0

    for i in arr:
        sum += i

    arr.sort()

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

main()

Solution (Python):
N,M = map(int,input().split())
Data = list(map(int,input().split()))
Sum = sum(Data)
cnt = 0
for d in Data:
    if d * 4 * M >= Sum:
        cnt += 1
if cnt >= M:
    print('Yes')
else:
    print('No')

Solution (Python):
from __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd



import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def lcm(n, m):
    return int(n * m / gcd(n, m))


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def find_gcd(list_l):
    x = reduce(gcd, list_l)
    return x


def main():
    n,m = map(int,input().strip().split())
    a = list(map(int, input().strip().split()))
    a.sort(reverse=True)
    eprint('a ',end=':\n')
    eprint(a)
    eprint('sum(a)/(4*m) ',end=':\n')
    eprint(sum(a)/(4*m))
    if a[m-1] >= sum(a)/(4*m) :
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = sorted(A, reverse = True)
if B[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()))

total_votes=sum(a)
over_votes=0

for i in a:
  if i>=total_votes/(4*m):
    over_votes+=1

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

Solution (Python):
def main():
    N, M = map(int, input().split(' '))
    An = list(map(int, input().split(' ')))
    thres = sum(An) / (4 * M)
    
    count = 0
    for a in An:
        if not thres > a:
            count += 1
            
    if count >= M:
        print('Yes')
    else:
        print('No')
    
    
    
    
main()

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

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

total_votes = sum(A)
is_over_thresh = [ai >= total_votes/(4*M) for ai in A]

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

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

A.sort(reverse=True)

base = sum(A)*1/(4*M)

if A[M-1]>=base:
	print('Yes')
else:
	print('No')

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

Solution (Python):
n, m = map(int, input().split())
num = [int(i) for i in input().split()]
num = sorted(num, reverse=True)
sum_num = sum(num)
for i in range(m):
    if num[i] < sum_num / (4 * m):
        print("No")
        break
else:
    print("Yes")

Solution (Python):
n, m = map(int, input().split())
num = [int(i) for i in input().split()]
num = sorted(num, reverse=True)
sum_num = sum(num)
for i in range(m):
    if num[i] < sum_num / (4 * m):
        print("No")
        break
else:
    print("Yes")

Solution (Python):



def run():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))[:n]
    b = sum(a) / (4 * m)

    if len(list(filter(lambda x: x >= b, a))) >= m:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    run()

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

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

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

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

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

B_n=sorted(A_n,reverse=True)

if B_n[M-1] >= sum(B_n)/(4*M) :
    print('Yes')
else:
    print('No')

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

sort = sorted(List)[::-1]
"""
昇順にソート
"""
ans = sort.pop(m - 1)
sum = sum(List)
if ans >= sum / (4 * m):
    print("Yes")
else:
    print("No")




"""
print(n)
print(m)
print(List)
print(sort)
print(ans)
"""

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

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

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

Solution (Python):
n,m = map(int, input().split())
nums = [int(i) for i in input().split()]
tot = 0
for i in nums:
  tot+= i
cons = tot/(4*m)
count = 0
for i in nums:
  if i>= cons:
    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()))

A.sort()
A.reverse()

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

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

n, m = map(int, input().split())
A = list(map(int, input().split()))
sm = sum(A)
cnt = 0
for a in A:
    if 4 * m * a >= sm:
        cnt += 1
can = "Yes" if cnt >= m else "No"
print(can)

Solution (Python):
data = input().split()
 
n = int(data[0])
m = int(data[1])
 
pro = [int(s) for s in input().split()]
 
vote = 0
for i in pro:
  vote += i
 
s_pro = sorted(pro, reverse=True)

if s_pro[m - 1] < vote * 1 / (4 * m):
  print("No")
else:
  print("Yes")

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

over=[]
for i in A:
    if i>=cutoff:
        over.append(i)

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

Solution (Python):
from sys import stdin
def main():
    
    readline=stdin.readline
    N,M=map(int,readline().split())
    A=list(map(int,readline().split()))
    
    A.sort(reverse=True)
    S=sum(A)
    if 4*M*A[M-1]>=S:
        print("Yes")
    else:
        print("No")
if __name__=="__main__":
    main()

Solution (Python):


import sys

sys.setrecursionlimit(100000)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7





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

s = sum(A)
cnt = 0
for a in A:
    if a * (4 * M) >= s:
        cnt += 1

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

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

ans = 0
minimum = sum(a) / (4*m)

for i in a:
    if i >= minimum:
        ans += 1

print('Yes' if ans >= m else 'No')

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

s=sum(a)

l=s/(4*m)


a.sort(reverse=True)
if(a[m-1]>=l):
    print("Yes")
else:
    print("No")

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

s=sum(a)

l=s/(4*m)


a.sort(reverse=True)
if(a[m-1]>=l):
    print("Yes")
else:
    print("No")

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

Solution (Python):
n,m=input().split()
n=int(n)
m=int(m)
sum,c=0,0
lt = list(map(int, input().split()))
for i in range(0,n):
    sum=sum+lt[i]
for i in range(0,n):
    if (sum/(4*m))<=lt[i]:
        c=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()))
sumA = sum(a)

sumBy4 = sumA/(4*m)

count = 0

for i in range(n):
    if(a[i] < sumBy4):
        continue

    else:
        count += 1

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

else:
    print("No")

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

arr.sort(reverse=True)
sum_arr = sum(arr)
flag = True

b = sum_arr/(4*m)
for i in range(m):
    if arr[i] < b:
        flag = False
        break
if flag:
    print('Yes')
else:
    print('No')

Solution (Python):
import numpy as np
n_m = [int(i) for i in input().split()]
ai = np.array([int(i) for i in input().split()])
n = n_m[0]
m = n_m[1]
asum = ai.sum()
thread = asum / (4 * m)
real_m = 0
for a in ai:
  if a < thread:
    continue
  else:
    real_m += 1
print("No") if real_m < m else print("Yes")

Solution (Python):
b = list(map(int, input().split()))
n = b[0]
m = b[1]
a = list(map(int, input().split()))
sum = sum(a)
a = sorted(a, reverse=True)

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

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
 
for i in a:
  if i >= sum(a)*(1/(4*m)):
    cnt += 1

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

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

total = sum(votes)

c = 0
threshold = 1 / (4 * m) * total
for v in votes:
    if c == m:
        break
    if v >= threshold:
        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)

limit = sum(a)/(4*m)
canselect = True
for i in range(0, m):
    if a[i] < limit:
        canselect = False

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

Solution (Python):
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
count = N
X = sum(A)
for a in A:
  if a < X / (4 * M):
    count -= 1
if count < M:
  print('No')
else:
  print('Yes')

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

a.sort(reverse=True)

ok = True

for i in range(m):
    if a[i] * 4 * m < sum(a):
        ok = False

print("Yes") if ok else print("No")

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

Solution (Python):

import numpy as np

n ,m = map(int, input().split())
a = np.array(list(map(int, input().split())))
t = a >= a.sum() * 1/(4*m)
if t.sum() >= m:
    print('Yes')
else:
    print('No')

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

c=0
for i in range(M):
    if A[i]<sum(A)/(4*M):c+=1
    else:c+=0
if c==0:print('Yes')
else:print('No')

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

Solution (Python):
nm = input().split(" ")
n = int(nm[0])
m = int(nm[1])
 
a = input().split(" ")
 
total = 0
for v in a:
  total += int(v)
  
mv = total / (4 * m)
q = 0
for e in a:
  e = int(e)
  if e >= mv:
    q += 1
    
if q >= m:
  print("Yes")
else:
  print("No")

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

for A_i in A:
    if A_i >= criteria:
        popular_items += 1
        
if popular_items >= M:
    ans = 'Yes'
else:
    ans = 'No'
    
print(ans)

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

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

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

a.sort(reverse=True)
a_sum = reduce((lambda x,y: x+y), a)
a_min = a_sum * (1/(4*m))

if (a[m-1] >= a_min):
  print('Yes')
else:
  print('No')

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

bool = True
for i in range(M):
    if sorted(A, reverse=True)[i] < sum(A)*(1/(4*M)):
        
        bool = False
    else:
        
        pass

if bool == True:
    print('Yes')
else:
    print('No')

Solution (Python):
n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
t = sum(a)

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

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

Solution (Python):
N, M = 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("Yes")
else:
	print("No")

Solution (Python):

N, M = map(int, input().split())
A = list(map(int, input().split()))
cnt = 0
for Ai in A:
    k = 1/(4*M)
    if (sum(A))*k <= Ai:
        cnt += 1
if cnt >= M:
    print("Yes")
else:
    print("No")

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

for i in l:

  if i >= s:
    c = c + 1
if c >= m:
  print('Yes')
else:
  print('No')

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

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

result = 'Yes' if sel >= m else 'No'
print(result)

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

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

total_vote = sum(a)

popular = [p for p in a if p >= total_vote/4/m]

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

Solution (Python):
"""
B-Popular Vote
"""

import sys
input = sys.stdin.readline
from collections import Counter, deque


INF = float('inf')


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

    total = sum(A)
    counter = 0
    for a in A:
        if total <= a * (4 * M):
            counter += 1

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


if __name__ == '__main__':
    main()

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

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

total = sum(A)
for i in range(n):
    if A[i] >= total / (4*m):
        count += 1
    else:
        continue
if count >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = map(int,input().split())
a = list(map(int,input().split()))
tot = 0
for x in a:
    tot += x
cnt = 0
for x in a:
    if 4*x*m >= tot:
        cnt += 1
if cnt < m:
    print("No")
else:
    print("Yes")

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

l = list(x for x in a if x >= (sum(a)/(4*m)))

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