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())
vote_ls = list(map(int, input().split()))

top_vote_ls = []
selectable = (1/(4*m))*sum(vote_ls)

for i in range(0, m):  
  max = 0
  for j in range(len(vote_ls)):      
    if vote_ls[j] > max: 
      max = vote_ls[j]; 
  vote_ls.remove(max); 
  if max >= selectable:
    top_vote_ls.append(max) 

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

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

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

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

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

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

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

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

A_sorted = sorted(A, reverse=True)

A_sum = sum(A)

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

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

Solution (Python):

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

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10


def solve():
    n, m = LI()
    a = LI()
    suma = sum(a)
    m4 = suma / 4 / m
    ans = 0
    for i in a:
        if i >= m4:
            ans += 1
    print("Yes" if ans >= m else "No")
    return



if __name__ == '__main__':
    solve()

Solution (Python):
nums1=[int(e) for e in input().split()]
nums2=[int(t) for t in input().split()]
all_vote = 0
sums = nums1[0]
for num in nums2:
  all_vote += num
for k in nums2:
  if (k/(all_vote) < 1/(4*nums1[1])):
    sums-=1
if(nums1[1]<=sums):
  print('Yes')
else:
  print('No')

Solution (Python):
import math
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
t = sum(a)
c = 0
f = 0
for i in range(n):
	if a[i] >= math.ceil(t/(4*m)):
		c += 1

if c>=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()
A.reverse()
border=sum(A)/(4*M)
for a in A[:M]:
    if a<border:
        print("No")
        break
else:
    print("Yes")

Solution (Python):
def main():
  
  n,m = map(int, input().split())
  A = sorted([int(x) for x in input().split()],reverse=True)
  
  asum = 0
  for a in A:
    asum += a
   
  if(A[m-1]>=asum/(4*m)):
    print("Yes")
  else:
    print("No")
  return 0
 
if __name__ == "__main__":
  main()

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: int, M: int, A: "List[int]"):
    sum = 0
    count = 0
    for i in A:
        sum += i


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

    if count >= M:
        print(YES)
    else:
        print(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=list(map(int,input().split()))
a.sort(reverse=True)
s=0
b=True
for i in a:
  s+=i

  
for i in range(0,m):
  if a[i]>=s/4/m:
    b=True
  else:
    b=False
    
if b:
  print('Yes')
else:
  print('No')

Solution (Python):
import sys

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

sou = sum(a)
list.sort(a, reverse=True)

for i in range(m):
    if a[i] < sou/(4*m):
        print('No')
        sys.exit()
print('Yes')

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
c=0
s=sum(a)
for i in range(n):
    if a[i] >= s*(1/(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_sum=sum(a)
num=len([x for x in a if x>=a_sum/(4*m)])
if num >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
[n, m] = list(map(int, input().split()))
votes = list(map(int, input().split()))
sumOfVotes = 0
largest = [0 for i in range(m)]

for v in votes:
  sumOfVotes += v
  if (largest[0] < v):
    largest[0] = v
    largest.sort()

if largest[0] * 4 * m < sumOfVotes:
  print("No")
else:
  print("Yes")

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

for i in range(n):
  if allVote/4 <= a[i]*m:
    counter +=1 
  else:
    break


if counter >= m:
  flag = True

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

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

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

judge = 1/(4*M)
count = 0


for i in range(M):
  if A[i] < judge*All:
    count += 1
    break

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

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

Solution (Python):
nm = input().split(" ")
alot = input().split(" ")

n = int(nm[0])
m = int(nm[1])

sum = 0
for i in range(n):
    sum = sum + int(alot[i])

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

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

Solution (Python):
N , M = input().split()
array = input().split()
flag = 0

N = int(N)
M = int(M)

iarray = []

for i in array:
    iarray.append(int(i))

total = sum(iarray)

for i in iarray:
    if i >= total/(4*M):
        flag += 1
if flag >= M:
    print("Yes")
else:
    print("No")

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

sum_A = sum(A)
SA = sorted(A,reverse=True)
cnt  = 0
f = 0
ck = 1/(4 * M)
for i in range(0,N):
    if SA[i]/sum_A < ck:
        break
    else:
        cnt +=1
        if cnt == M:
            f = 1
            break
if f == 1:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
readline = sys.stdin.readline
n,m = map(int,readline().rstrip().split())
s = readline().rstrip().split()
total = 0
for i in s:
  total+=int(i)
cnt =0
for i in s:
  if int(i) >= total/(4*m):
    cnt+=1
if cnt >= m:
  print('Yes')
else:
  print('No')

Solution (Python):
n, m = input().split()
l = sorted(list(map(int, input().split())))
sum_touhyou = sum(l)
line_touhyou = sum_touhyou * (1 / (int(m) * 4))

r = [i for i in l if i >= line_touhyou]

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

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

all = list(map(int, input().split()))
all.sort(reverse=True)
flg = []
for i in range(m):
  if all[i] < (sum(all)*1/(4*m)):
      flg.append(False)
  else:
      flg.append(True)

if False in flg:
  print("No")
else:
  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 = 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):
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

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

Solution (Python):
tmp = list(map(int, input().split()))
num = list(map(int, input().split()))

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

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

Solution (Python):

first_input = list(map(lambda x:int(x), input().split(" ")))
second_input = list(map(lambda x:int(x), input().split(" ")))

second_input.sort(reverse=True)
criteria = sum(second_input)/float(4*first_input[1])

count = 0
for i in range(len(second_input)):
    if second_input[i]>=criteria:
        count = count+1
    else:
        break

if count >= first_input[1]:
    print("Yes")
else:
    print("No")

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
pop = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(pop) >= m else "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 += A[i]
for j in range(N):
  if A[j] >= total / ( 4 * M ):
    count += 1
  else:
    pass
if count >= M:
  print("Yes")
else:
  print("No")

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

popular = list(filter(lambda x: x >= (1/(4*m))*sum(a), a))

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

Solution (Python):
import sys

def main():

	S = 0
	N,M = map(int, input().split())
	Lists = list(map(int, input().split()))
	
	count = 0
	
	for List in Lists:
		S += List
	
	
	for List in Lists:
		if List >= S/4/M:
			count += 1
	
	if count >= M:
		print("Yes")
	else:
		print("No")
	
if __name__ == "__main__":
    main()

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

length = len(A)

for idx in range(len(A)):
    if A[idx] < sum(A)/(4*M):
        length -= 1

ans = 'Yes' if length>=M else 'No'
print(ans)

Solution (Python):
from decimal import Decimal

cnt, m = map(int, raw_input().split())
targets = map(int, raw_input().split())

limit = Decimal(str(sum(targets))) / Decimal(str(4 * m))

n = 0
for target in targets:
    if target >= limit:
        n += 1

print 'Yes' if n >= m else 'No'

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


sum = 0
for i in range(len(vote)):
    sum  = sum + vote[i]


j = sum/(4*M)


num = 0
for i in range(len(vote)):
    if vote[i] >= j:
        num = num + 1
    else: continue


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

Solution (Python):
s = input().split()
i = s[0]
m = int(s[1])
count = 0
sun = 0
el = input().split()
for p in el:
    sun += int(p)
for k in el:
    if int(k) >= sun / (4 * m):
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")

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

Solution (Python):
import math
import sys

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



a = input().split()
l_si_i = [int(b) for b in a]






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


check = 0
for i in range(n):
  if l_si_i[i] >= border:
    check += 1
    
  if check >= m:
    print("Yes")
    sys.exit()
    
print("No")

Solution (Python):

def main():
    n,m = map(int,input().split())
    lst = list(map(int,input().split()))
    total = sum(lst)
    counter = 0
    for i in lst:
        if i >= total * (1 / (4 * m)):
            counter += 1

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

Solution (Python):
N, M = [int(e) for e in input().split()]
A = sorted([int(e) for e in input().split()])
A.reverse()

base =float(sum(A)) / 4.0/M
cond = all([float(e) >= base for e in A[:M]])
ans = 'Yes' if cond  else 'No'
print(ans)

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

sum_a = sum(a)

for i in range(m):
    if a[i] >= sum_a/(4*m):
        continue
    else:
        print('No')
        exit()

print('Yes')

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

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

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

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


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

deadline = total / (4*m)


cnt = 0
for i in range(n):
    if a[i] >= deadline:
        cnt += 1

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

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

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

Solution (Python):


n,m= list(map(int,input().split()))
A = list(map(int,input().split()))
d = sum(A)
    
A.sort(reverse=True)
for a in range(m):
    if A[a]< d/(4*m):
        d = 0
        break
if d == 0:print("No")
else: print("Yes")

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

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

a = sum(x>=float(sum(List)/(4*m)) for x in List)
print("Yes" if a >= m else "No")

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

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

total=0
for i in range(n):
	total = total + sa[i]

score = 0
for i in range(m):
	if sa[i]>=total/(4*m):
		score = score +1
if score>=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 = 0
for i in range(N):
    s += a[i]
border = s/(4*M)
if a[M-1] < border:
    print('No')
else:
    print('Yes')

Solution (Python):
N, M = map(int, input().split())
A = sorted(map(int, input().split()))
A = A[::-1]
hyou = sum(A)

ok = True
if float(A[M-1]) < hyou/(4*M):
    ok = False

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

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

Solution (Python):
from fractions import Fraction as F
n, m = map(int, input().split())
A = list(map(int, input().split()))
S = sum(A)
T = S * F(1, 4 * m)

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

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

Solution (Python):
N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A = sorted(A, reverse=True)
total = sum(A)

f = True

for i in range(M):
    if total / (4 * M) > A[i]:
        f = False

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

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

ls = list(map(int, input().split()))
ls = sorted(ls,reverse=True)
print("Yes" if ls[m-1]*4*m >=sum(ls) else "No")

Solution (Python):
import numpy as np

ll=list(map(int,input().split()))
case=np.array(list(map(int,input().split())))

case[::-1].sort()

total=np.sum(case)
line=total/4/ll[1]

target=case[ll[1]-1]

if target >= line:
    print('Yes')

else:
    print('No')

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

Solution (Python):
from operator import add
from functools import reduce

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

threshold = (1 / (4 * m)) * reduce(add, aa)
count = 0
for a in aa:
    if threshold <= a:
        count += 1
if m <= count:
    print('Yes')
else:
    print('No')

Solution (Python):
data = list(map(int, input().split()))
n = data[0]
m = data[1]
li = list(map(int, input().split()))
S = sum(li)
count=0
for i in li:
  if i < S*(1 / 4 / m):
    count+=1

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

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

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

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


vote = map(int, raw_input().split())
total = sum(vote)
thres = 1/float(4*M)*total
cnt = 0
for v in vote:
    if v >= thres:
        cnt = cnt + 1

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

Solution (Python):
import numpy as np
 
n, m = map(int, input().split())
 
an = list(map(int, input().split()))
 
an = np.array(sorted(an, reverse=True))
 
total = sum(an)
 
if sum(an[:m] >= (total / (4 * m))) >= 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())))
if len(A[A >= A.sum()/(4*M)])>=M:
    print('Yes')
else:
    print('No')

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

sumValue = sum(points)

candidates = [i for i in points if float(i) >= (sumValue/(4*m))]

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

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

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

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

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

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

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

b = 0
for i in A:
    if i >= jud:
        b = b+1
if b >= M:
  print('Yes')
else:
  print('No')

Solution (Python):

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

status = True

goukei = sum(a)
c = goukei * 1/(4*m)

for _ in range(m):
    if a[0] >= c:
        a.pop(0)
    else:
        status = False

if status:
    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 = map(int,input().split())
A = list(map(int,input().split()))
S = sum(A)
ans = [i for i in A if i >= S / (4*M)] 
if len(ans) >= M:
    print('Yes')
else:
    print('No')

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

check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1

ans = N - x

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

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

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

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

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

    sa = sum(A)
    cnt = 0
    x = sa // (4 * m) - 1 if sa % (4 * m) == 0 else sa // (4 * m)
    for a in A:
        if a > x:
            cnt += 1

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

if __name__ == "__main__":
    main()

Solution (Python):

from sys import stdin
from operator import itemgetter
import math


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

hyo = list(map(int,[int(x) for x in stdin.readline().rstrip().split()]))
sort_hyo = sorted(hyo, reverse=True)
point = sum(hyo)
target = math.ceil(point / (4*M))
for i in range(len(hyo)):
    if sort_hyo[i] >= target:
        sort_hyo[i] = "Yes"
    else:
        sort_hyo[i] = "No"
        
print(sort_hyo[M-1])

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 = map(int,input().split())
a = [int(x) for x in input().split()]
ans = 'Yes'
list.sort(a, reverse=True)
for i in range(m):
  if a[i]/sum(a) < 1/(4*m):
    ans = 'No'
print(ans)

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=map(int,input().split())
A=list(map(int,input().split()))

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

A=[i for i in A if i>=m]

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

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


A=list(map(int,input().split()))
Sum=sum(A)
pop=[]
l=Sum/(4*M)
for i in range(N):
    if(A[i]>=l):
        pop.append(A[i])
        
print("Yes" if len(pop)>=M else "No")

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

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

A.sort(reverse=True)
total_point = sum(A)

selectable = False

if total_point * (1 / (4 * M)) <= A[M-1]:
    selectable = True

if selectable:
    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 = map(int, input().strip().split())
as_ = map(int, input().strip().split())

as_ = sorted(as_, reverse=True)

boundary = as_[m - 1]
if boundary < sum(as_) /(4 * m):
    print('No')
else:
    print('Yes')

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):
nm = input().split(" ")
n = int(nm[0])
m = int(nm[1])
inputlist = list()
count = 0
total = 0
if n >= m and m >= 1 and n >= 1 and n <= 100 and m <= 100:
    inputlist = input().split(" ")
    for i in inputlist:
        total = total + int(i)
    con = total / (m *4)
    for i in inputlist:
        i = int(i)
        if i >= con:
            count = count + 1
        else:
            count = count
    if count >= m:
        print("Yes")
    else:
        print("No")
else:
    print()

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

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

Solution (Python):





import functools

if __debug__:
    def debug(arg):
        pass
else:
    import sys
    def debug(arg):
        debug = lambda *x: None
        print(arg, file=sys.stderr)

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

debug([m, n])
debug(a)

c = 0
t = sum(a)
debug(t)
s = t / (4 * m)
debug(s)
for aa in a:
    if aa >= s:
        c += 1
        if c >= m:
            print('Yes')
            exit()


print('No')

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

Solution (Python):

N,M = (int(x) for x in input().split(" "))
A = list(map(int, input().split()))
A_sorted =sorted(A,reverse=True) 


pan_sum = sum(A)
if A_sorted[M-1] < pan_sum/4/M:
    print("No")
else:
    print("Yes")
"""
print(pan_sum)
print(A[M-1])
print(pan_sum/4/M)
"""

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

Solution (Python):
n,m = (int(x) for x in input().split())
list = list(map(int,input().split()))
su1 = sum(list)
su2 = 0
for i in range(n):
    if list[i]>=su1/(4*m):
        su2+=1
if su2>=m:
    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=map(int, input().split())
A=list(map(int, input().split()))
count=0

for a in A:
         if a>=sum(A)/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=sorted(A)[::-1]
A_criterion=sum(A)/4/M
ans="Yes"
if A_sort[M-1]<A_criterion:
    ans="No"
print(ans)

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

check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1

ans = N - x

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

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

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

A.sort(reverse=True)

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

Solution (Python):
import sys
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
b = sorted(b, reverse=True)




def canSelect(a, total, M):
    return a >= total / (4 * M)


def returnWord(flag):
    if flag:
        return 'Yes'
    return 'No'


total = sum(b)
M = a[1]
count = 0
res = 'Yes'
for i in b:
    count += 1
    if not canSelect(i, total, M):
        res = returnWord(False)
    if count == M:
        print(res)
        sys.exit()

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

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

ch = 0
for j in range(M):
    if A[j] < Total/(4*M):
        ch += 1
    else:
        continue
        
if ch > 0:
    print("No")
else:
    print("Yes")

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

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

th = sum(A)/(4*int(M))
for i in range(int(M)):
  if A[int(M)-1-i] < th:
    ans="No"
    break
print(ans)

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

cond = sum(Alist) * (1 / (4 * M))
count = 0

for A in Alist:
    if A >= cond:
        count += 1

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

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

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

over_count = sum([1 if a >= thresh_score else 0 for a in A])
print('Yes' if over_count >= M else 'No')

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

waru = 4 * M
SUM = sum(list_a)
vote = SUM / waru

for i in range(0, N):
    if list_a[i] >= vote:
        count += 1
    else:
        pass

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

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

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