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()))

voteN = sum(A)

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

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

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

Solution (Python):
nm = [int(x) for x in input().split()]
n = nm[0]
m = nm[1]
total = 0
result = 0
votes = [int(x) for x in input().split()]
for vote in votes:
  total+=vote
total/=4*m
for vote in votes:
  if vote>=total:
    result+=1
if result>=m:
  print("Yes")
else:
  print("No")

Solution (Python):
import math


n, m = map(int, input().split())
ls = list(map(int, input().split()))
ls.sort(reverse=True)
gk = sum(ls)
hikaku = math.ceil(gk/(4*m)) 

if hikaku <= int(ls[m-1]):
  print('Yes')
else:
  print('No')

Solution (Python):
from sys import stdin

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


A.sort()
if sum(A) % (4*M) == 0:
    b = sum(A)//(4*M)
else:
    b = sum(A)//(4*M)+1

if A[N-1-(M-1)] >= b:
    print("Yes")
else:
    print("No")

Solution (Python):
N, M = map(int, input().split())
lists, count = [int(x) for x in input().split()], 0
for x in lists:
    if x >= ((1 / (4 * M)) * sum(lists)):
        count += 1
print('Yes' if count >= M else 'No')

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

for m in range(M):
    s = sum(A)
    if A[m] >= s / (4 * M):
        a = True
    else:
        a = False

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

Solution (Python):

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

sum_A = sum(A)

bool_list = []

for i in range(len(A)):
    if A[i] >= (sum_A / (4*M)):
        bool_list.append("T")

    else:
        continue


if bool_list.count("T") >= M:
    print("Yes")

else:
    print("No")

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

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

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

Solution (Python):
n,m = map(int,input().split())
lis = input().split()
lis = [int(i) for i in lis]
s = sum(lis)
ans = 0


for i in range(n):
    if lis[i] >= s*(1/(4*m)):
        ans += 1


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

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

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

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

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

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

for i in range(M):
  s = sum(num)
  if sss[i] >= s/(4*M):
    pass
  else:
    print('No')
    f = False
    break
if f:
  print('Yes')

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

Solution (Python):
L=list(map(int, input().split()))
N=L[0]
M=L[1]
A=list(map(int, input().split()))

tf=0
sum=0

for h in range(N):
    sum += A[h]

list.sort(A,reverse=True)

for i in range(M):
    if A[i]<(sum/(4*M)):
        tf = 1
        break

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

Solution (Python):
N,M=map(int,input().split())
A=[int(b) for b in input().split()]
cnt=0
ans=sum(A)/(4*M)


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


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

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

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

Solution (Python):
n, m = map(int, input().split())
cnt = 1 / (4 * m)
a = list(map(int, input().split()))

tmp = 0
for i in a:
    if i >= sum(a) * cnt:
        tmp += 1

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

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

S = sum(A)

f = S / (4 * M)

A.sort(reverse=True)

flag = 0

for i in range(M):
  if A[i] >= f:
    pass
  else:
    flag = 1
    break

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

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

s = sum(A)

c = list(filter(lambda a: a >= s / (4 * M), A))

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

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

sum = 0
for a in A:
  sum += int(a)


limit = sum/(4*int(M))

j = 0
for i in range(N):
  if int(A[i])>=limit:
    j += 1


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

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

hoge = 4*M
thr = sum(num_list) / hoge

ans = 'Yes'
if sorted_list[M-1] < thr:
    ans = 'No'


print(ans)

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

L = math.ceil(sum(S) / (4 * M))
SS = 0
for s in S:
        if s // L >0:
        	SS+=1

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

Solution (Python):
N,M = map(int,input().split())
li = list(map(int,input().split()))
x = sum(li) / (4*M)

l = [i for i in li if i >= x]
if len(l) >= M:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
choicable = list(map(lambda x:True if x>=sum(a)/(4*m) else False,a))
print('Yes' if sum(choicable) >= m else 'No')

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

    thresh = sum(A) / (4*M)
    items = [a for a in A if a >= thresh]

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



if __name__ == "__main__":
    b()

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
X=sorted(a,reverse=True)
v=sum(a)
v/=(4*m)
cnt=0
for x in X:
    if x>=v:
        cnt+=1
print('Yes' if cnt>=m else 'No')

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

mm = sum(A) / (4 * M)
print('Yes' if len([i for i in A if i >= mm]) >= M else 'No')

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

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

sum = 0
i = 0
while i != N:
    sum += A[i]
    i += 1

vote = sum / (4 * M)

i = 0
while i != M:
    if A[i] < vote:
        print("No")
        break
    i += 1
    if i == M:
        print("Yes")

Solution (Python):
import math

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

cond = sum(AS) / (4 * M)
AS = sorted(AS, reverse=True)

origin = AS[0:M]
result = list(filter(lambda a: a >= cond, origin))

if origin == result:
    print("Yes")
else:
    print("No")

Solution (Python):
N,M=map(int, input().split())
A=list(map(int, input().split()))
s=sum(A)
d=s/(4*M)
count=0
i=0
while(i<N):
    if(A[i]>=d):
        count=count+1
    i=i+1

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

Solution (Python):


N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
sum_A = sum(A)
flag = 0
A.sort(reverse=True)
for i in range(M):
    if A[i]/sum_A < 1/(4*M):
        flag = 1

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

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

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

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

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

As.sort(reverse=True)

al = sum(As)

ans = 'No' if al/(4*M)>As[M-1] else 'Yes'
print(ans)

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

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

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

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

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

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

Solution (Python):

import collections


def solve(n, m, arr):
    totalVotes = sum(arr)

    arr.sort(reverse=True)

    for i in range(m):
        if arr[i] < (totalVotes / (4 * m)):
            return False

    return True


[n, m] = list(map(int, input().strip().split()))
arr = list(map(int, input().strip().split()))

print("Yes" if solve(n, m, arr) else "No")

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

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

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

list.sort(a,reverse=True)
judge = 1

for i in range(m):
    if a[i]< a_sum*1/(m*4):
        judge = 0
        break

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

Solution (Python):
n, m = map(int, input().split())
list_vote = list(map(int, input().split()))
list_vote_copy = list_vote[:]
total_votes = sum(list_vote)
check = (total_votes / (4 * m))
count = 0
for ele in list_vote_copy:
    if ele >= check:
        count += 1

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

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

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

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

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

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

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

total = sum(A)
border = total / (4*m)
count = 0

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

ans = "Yes"
if count < m:
    ans = "No"

print(ans)

Solution (Python):
N,M = [int(i) for i in input().split()]
AList = [int(i) for i in input().split()]

H = sum(AList)/(4*M)

S =0

for A in AList:
  if A>= H:
    S = S + 1

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

Solution (Python):
inp = input()
v = input().split(" ")

n = int(inp.split(" ")[0])
m = int(inp.split(" ")[1])

votes = [int(v_) for v_ in v]
votes.sort(reverse=True)

total = sum(votes)
border = total / ( 4 * m )

i = 1
for vote in votes:

    if vote < border :
        print("No")
        exit()

    if i == m:
        print("Yes")
        exit()

    i+=1

Solution (Python):
import sys

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

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

cnt = 0
for i in l:
    if float(i) < float(sum(l)*1/(4*m)):
        cnt += 1
    if cnt > len(l)-m:
        print("No")
        sys.exit()

print("Yes")

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

Solution (Python):

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

quat = sum(a) / (4*m)
cnt = 0
for i in a:
    if i >= quat:
        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 = sum(list(map(lambda x: x >= sum(a)/(4*m), a)))
print('Yes' if m<=b else 'No')

Solution (Python):
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time

from fractions import gcd

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


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


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

from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time

from fractions import gcd

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


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


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


N, M = inp_list()
A = inp_list()
A.sort(reverse=True)
total = sum(A)

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

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


flg = 0

a_list.sort()
a_list.reverse()

all = 0

for i in range(n):
    all += a_list[i]

all = all*(1/(4*m))


for j in range(m):
    if a_list[j] < all:
        flg = 1

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

Solution (Python):
import numpy as np

input_str = input()
N, M = list(map(lambda x: int(x), input_str.split(' ')))

input_str = input()
input_list = np.array(list(map(lambda x: int(x), input_str.split(' '))))

A_sum = np.sum(input_list)

count = np.count_nonzero(input_list >= A_sum / (4*M))

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

Solution (Python):
n, m = map(int, input().split())
a = [int(i) for i in input().split(" ")]
s = sum(a)
c = s/(4*m)
ans = [1 for i in a if i >= c]
if len(ans) >= m:
    print("Yes")
else:
    print("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):
def solve():
    n, m = map(int, input().split())
    A = list(map(int, input().split()))

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

    th = sm / (4 * m)
    cnt = 0
    for a in A:
        
        if a >= th:
            cnt = cnt + 1

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



if __name__ == '__main__':
    solve()

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

total = sum(A)

noselect = 0
for i in range(N):
    if A[i] < total / (4*M):
        noselect += 1

if N - noselect >= M:
    print('Yes')
else:
    print('No')

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

Solution (Python):
n, m = map(int, input().split())
alis = list(map(int, input().split()))
func = lambda x : x >= (sum(alis)/(4*m))
anslis = list(map(func, alis))
if anslis.count(True) >= m:
    print('Yes')
else:
    print('No')

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

s = input().split(" ")
sum = 0
l = []
for i in range(N):
    sum += int(s[i])
    l.append(int(s[i]))

l = sorted(l, reverse=True)
yes = True

for i in range(M):
    if int(l[i]) < sum / (4 * M):
        yes = False
if yes:
    print("Yes")
else:
    print("No")

Solution (Python):
N,M= map(int, input().split())
a = list(map(int,input().split()))
b = sorted(a,reverse = True)
total = 0
for i in range(len(b)):
  total += b[i]

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

Solution (Python):
i = list(map(int, input().split()))
j = list(map(int, input().split()))

j.sort(reverse=True)
k = i[1]
l = sum(j)
k_k = k*4

if j[k-1] >= l /k_k:
    print('Yes')
else:
    print('No')

Solution (Python):
N,M = map(int, input().split())
A = list(map(float, input().split()))
sum_A = sum(A)
cout = 0
flag = False
for i in range(N):
  if A[i] >= sum_A / (4 * M):
    cout += 1
    if cout >= M:
      flag = True
      break
      
if flag:
  print('Yes')
else:
  print('No')

Solution (Python):
def get_int_list(inp_str):
    return list(map(int, inp_str.split(" ")))

n, m = get_int_list(input())
objs = get_int_list(input())

threshold = sum(objs) / (4 * m)
ans = [o >= threshold for o in objs]
num = sum(ans)
if num >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
n,m = map(int,input().split())
line = sorted(list(map(int,input().split())),reverse = True)
sums = sum(line)
if sums % (4*m) != 0:
  least = sums//(4*m) + 1
else:
  least = sums//(4*m)
box = []
for i in line:
  if i >= least:
    box.append(i)
if len(box) >= m:
  print("Yes")
else:
  print("No")

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

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
b = float(sum(A)/(4*M))
num = 0
for i in range(N):
    if A[i] >= b:
        num += 1
        
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)
t = sum(a)
p = 0
for i in range(n):
  if a[i] >= t/(4*m):
    p += 1
  else:
    break

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

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

Solution (Python):
import math
import sys

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

vote = []
vote = list(map(int, input().split()))
sum_n = sum(vote)

i = 0
while i < M:
    max_n = max(vote)
    if max_n < math.ceil(sum_n / (4 * M)):
        print("No")
        sys.exit()
    vote.pop(vote.index(max_n))
    i += 1

print("Yes")

Solution (Python):
INPUT = input().split()
N = int(INPUT[0])
M = int(INPUT[1])
score_list = input().split()
score_list_int =  [int(n) for n in score_list]

border = sum(score_list_int)/4/M

answer = "Yes"

for i in score_list_int:
    if i < border:
        N -= 1

if N < M:
    answer = "No"
    
print(answer)

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())
List =list( map(int,input().split()))
S = sum(List);
count = 0;
for i in range(N):
    if List[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()))
S = sum(A)
A_selected = [a for a in A if a >= (S/4/M)]
ret = len(A_selected) >= M
if ret:
    ret_str = 'Yes'
else:
    ret_str = 'No'
print(ret_str)

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

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
sou = 0
for i in a:
    sou += i
line = sou/(4*m)
count = 0
for i in a:
    if i >= line:
        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=sum(A)
c=0
for i in range(N):
	if A[i]*4*M>=a:
		c+=1
if c>=M:
	print('Yes')
else:
	print('No')

Solution (Python):



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

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

s = sum(an)

cnt = 0
for a in an:
    if a >= s / (4 * m):
        cnt += 1

if cnt >= 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)
B = A[0:M]
C = B[-1]
Sum =  sum(A)
if C >=Sum /(4*M):
    print("Yes")
else:
    print("No")

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

a_sum = sum(A)
ans = 0
for i in range(n):
    if float(A[i]) >= a_sum/(4*m):
        ans += 1


if ans >= 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)

sumPolls = sum(A)
criteria = sumPolls / (4 * M)

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

Solution (Python):
import sys
N,M = map(int, input().split())
A = list(map(int, input().split()))
sorted_A = sorted(A, reverse=True) 
all_A = sum(A)

rule = (1/(4*M))

ans = 0

for i in A:
    if (i / all_A) >= rule:
        ans = ans + 1
    else:
        pass

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

Solution (Python):

N, M = [int(t) for t in input().split(" ")]
votes = [int(t) for t in input().split(" ")]
total = sum(votes)
t = total/(4*M)

popular = [v for v in votes if v >= t]
if len(popular) >= M:
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = list(map(int, input().split()))
l = list(map(int, input().split()))
r = list(filter(lambda x:x >= sum(l)/(4*m),l))
if len(r) >= m:
    print('Yes')
else:
    print('No')

Solution (Python):

import sys

YES = "Yes"
NO = "No"

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

least = sum(A) / (4 * M)

B = sorted(A,reverse=True)

cnt = 0
for i in range(N):
    if B[i] >= least:
        cnt += 1
    else:
        break

if cnt >= M:
    print(YES)
else:
    print(NO)

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

A = list(map(int,input().split()))
su = sum(A)
A.sort(reverse=True)

cnt = 0
for i in A:
  if (i >= su / 4 / M):
    cnt += 1
if (cnt >= M):
  print('Yes')
else:
  print('No')

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

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=[int(x) for x in input().split()]
A=[int(x) for x in input().split()]

cnt=0
for i in range(N):
    if A[i] >= sum(A)/(4*M):
        cnt+=1
if cnt>=M:
    print("Yes")
else:
    print("No")

Solution (Python):
N,M=map(int, input().split())
Alist = list(map(int, input().split()))
Alist.sort(reverse=True)
sumnation = sum(Alist)
bordernum = sumnation / (4*M)
for i in Alist[:M]:
    judlist = []
    temp = True if i >= bordernum else False
    judlist.append(temp)
    judged =  all(judlist)
if judged:
    print('Yes')
else :
    print('No')

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

sortedA = sorted(A, reverse=True)

AA = sum(A)
de = AA/(4*M)
picA = sortedA[0:M]


if (picA[-1] < de):
  print("No")
  
else:
  print("Yes")

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

Solution (Python):

import sys, io, os
input = sys.stdin.readline
inputt = lambda: range(int(input()))
inputn = lambda n = 1: range(n)
inputi = lambda: map(int, input().split())
inputl = lambda: list(inputi())
from math import *
from heapq import *
from bisect import *
from functools import reduce, lru_cache
from collections import Counter, defaultdict
from builtins import *

N, M = inputi()
A = inputl()
S = sum(A)
t = ceil(S / (4 * M))
b = (sum(a >= t for a in A) >= M)
if b:
    print("Yes")
else:
    print("No")

Solution (Python):
NM = input().split();
N,M = int(NM[0]),int(NM[1]);
A = list(map(int, input().split()));
A.sort(reverse=True);


Sum = 0;
for i in range(N):
    Sum = Sum + A[i];
    

fil = Sum / (4 * M);


count=0;
for j in range(M):
    if(A[j] >= fil):
        count+=1;

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

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

count = 0
x = sum(a_list)/(4*m)
for i in range(0,n):
  if a_list[i] >= x :
    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)
print("Yes" if a[m-1]*4*m >= sum(a) else "No")

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

s = sum(a)
crit = s / (4 * m)
a.sort()
a.reverse()

if a[m-1] < crit:
  print('No')
else:
  print('Yes')

Solution (Python):
import math

n,m = map(int,input().split())
s = list(map(int,input().split()))
 
votes = 0
for i in range(n):
    votes += s[i]
 
s.sort(reverse=True)
 
for i in range(m):
    if s[i] < math.ceil(votes/(4*m)):
        print("No")
        exit()
 
print("Yes")

Solution (Python):
species, num = [int(i) for i in input().split()]
votes = [int(i) for i in input().split()]

sum_vote = sum(votes)
min_rate = sum_vote / 4 / num
votes.sort(reverse=True)

ans = 'Yes' if votes[num - 1] >= min_rate else 'No'

print(ans)

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

A_list.sort(reverse=True)
SUM = sum(A_list)

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

Solution (Python):
nm = list(map(int, input().split()))
a = list(map(int, input().split()))
Sum=0
flag=0

for i in range(len(a)):
    Sum+=a[i]

a.sort(reverse=True)

for i in range(nm[1]):
    if a[i]<Sum/(4*nm[1]):
        flag=1
        break

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

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

judge = sum(A) / (4 * M)

ans = 0
for i in range(N):
    if A[i] >= judge:
        ans += 1

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

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







count = 0
for aa in a:
    
    if aa >= sum_a / (4 * m):
        count += 1
        

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

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

sigma_A = sum(lists)
val = 1/(4 * M) * sigma_A

count = 0
for i in range(M):
    if max(lists) >= val:
        count += 1
        lists.remove(max(lists))


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)
if A[M-1]>=sum(A)/(4*M):
    print("Yes")
else:
    print("No")

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

all_num = sum(As)

test = []
test = sorted(As)[::-1]

is_true = True
new = []
key = all_num * (1 / (4 * M))
for idx in range(len(test)):

    if test[idx] < key:
        new = test[:idx]
        is_true = False
        break

if is_true:
    len_ans = len(test)

else:
    len_ans = len(new)


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

Solution (Python):

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

new_arr = sorted(arr, reverse=True)
ans=new_arr[M-1]
total=sum(new_arr)
waru =4*M


if ans >= total/waru:
    print("Yes")
else:
    print("No")

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


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

intlist = list(map(int, input().split()))
newlist = sorted(intlist, reverse=True)[:M]

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

Solution (Python):
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp



class UnionFindEx:
    def __init__(self, size):
        
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'

def main():
    N,M=mis()
    A = lmis()
    S = sum(A)
    ok = sum((4*M)*a>=S for a in A)
    if ok >= M:
        print(Yes)
    else:
        print(No)



main()

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

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