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())
products = [int(s) for s in input().split()]
products.sort(reverse=True)

border = sum(products) / 4 / m

cnt = 0
ans = 'No'
for i in products:
    if border <= i:
        cnt += 1
        if cnt == m:
            ans = 'Yes'
            break

print(ans)

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

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

Solution (Python):
n,m = map(int,input().split())
ary1 = list(map(int,input().split()))
sikii = sum(ary1)/(4.0*m)
kosuu = len([x for x in ary1 if float(x)>=sikii])
if kosuu >= m :
  print("Yes")
else:
  print("No")

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

popular=[i for i in A if i>=sum(A)/(4*M)]

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

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

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

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

total = sum(votes)

valid = True
for i in range(m):
    if votes[i] < total/(4*m):
        valid = False
        break

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

Solution (Python):
x,y= list(map(int, input().split()))
i = list(map(int, input().split()))
i.sort(reverse=True)
k=sum(i)
flag=0
for j in range(x):
    if i[j]*4*y>=k:
        flag+=1
if flag<y:
    print("No")
else:
    print("Yes")

Solution (Python):
x,y= list(map(int, input().split()))
i = list(map(int, input().split()))
i.sort(reverse=True)
k=sum(i)
flag=0
if i[y-1]>=k/(4*y):
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = [int(i) for i in input().split()]
data = sorted([int(i) for i in input().split()], reverse = True)
if data[m - 1] >= sum((data)) / (4 * 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)
count=0
for i in a:
    if i>=border:
        count+=1
if count>=m:
    print("Yes")
else : 
    print("No")

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

t = 0
s = sum(x for x in list_a)

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

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

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

item.sort(reverse=True)

s = sum(item)
res = 0
for i in range(n):
  if item[i] >= s / (4*m):
    res += 1
    if res >= m:
      print('Yes')
      break
  else:
    print('No')
    break

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

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

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

lim=sum(A)/(4*M)
cnt=0
for a in A:
  if a>=lim:
    cnt+=1
print(("No","Yes")[cnt>=M])

Solution (Python):
n, m = map(int, input().split())
a = list(map(float, input().split()))
A = sum(a) / (4 * m)
N = sum(x >= A for x in a)
print('Yes' if N >= m else 'No')

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse = True)
total = sum(A)
if A[M-1] >=total/(4*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):








import numpy as np




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


arrA = np.array(input().split(),dtype=np.int64)

arrA.sort()
arrA = arrA[::-1]
total = arrA.sum()

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

print(ans)

Solution (Python):
n, m = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
k = []
for i in l:
  if(i >= sum(l)/(4*m)):
    k.append(i)
if(len(k) < m):
  print("No")
else:
  print("Yes")

Solution (Python):
N,M=[int(x) for x in input().rstrip().split()]
A=[int(x) for x in input().rstrip().split()]
sum_A=sum(A)
cnt=0
for i in range(len(A)):
    if 4*M*A[i]<sum_A:
        continue
    else:
        cnt+=1
if M<=cnt:
    print("Yes")
else:
    print("No")

Solution (Python):
n,m = list(map(int,input().split()));arr = list(map(int,input().split()))
arr.sort(reverse = True);total = sum(arr)
print("Yes" if arr[m-1] * 4 * m >=total else "No")

Solution (Python):
n,m=map(int, input().split())
a=list(map(float, input().split()))
A=sum(a)/(4*m)
N=sum(x>=A for x in a)
if N>=m:
    print("Yes")
else:
    print("No")

Solution (Python):
n,m=map(int, input().split())
a=list(map(float, input().split()))
A=sum(a)/(4*m)
N=sum(x>=A for x in a)
if N>=m:
    print("Yes")
else:
    print("No")

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

A_total = sum(A)
B = sorted(A, reverse=True)

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

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
all = sum(A)
if all % (4 * M) != 0:
    cut = all // (4 * M)
else:
    cut = all // (4 * M) - 1
count = 0
for i in A:
    if i > cut:
        count += 1
if count >= M:
    print('Yes')
else:
    print('No')

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

    A.sort(reverse=True)

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

    thr = all_num / (4*M)

    for i in range(M):
        if A[i] < thr:
            print("No")
            exit()
    
    print("Yes")

main()

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

sum = 0

for item in an:
  sum += item

num = 0

for item in an:
  if item >= sum / (4 * m):
    num += 1

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

Solution (Python):
n,m=map(int, input().split())
a=list(map(int, input().split()))
g=0
count=0
for i in a:
    g+=i
b = float(1/(4*m))
for i in a:
    t = float(i/g)
    if t>=b:
        count+=1
    if count==m:
        print("Yes")
        exit()
if count < m:
    print("No")

Solution (Python):
n_and_m = list(map(int, input().split()))
n = n_and_m[0]
m = n_and_m[1]
items = list(map(int, input().split()))
REQUIRED = ( 1 / (4*m) ) * sum(items)
flag = 0

for item in items:
    if item >= REQUIRED:
        flag += 1

        

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

Solution (Python):
s=input()
nn=s.split()
n=int(nn[0])
m=int(nn[1])
s=input()
aa=s.split()
a=[]
tot=0
for i in range(0,len(aa)):
	a.append(int(aa[i]))
	tot+=a[i]
num=0
for i in a:
	if i>=tot/(4*m) :
		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_total = sum(A)
B = sorted(A, reverse=True)

if B[M-1] < A_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)
satisfied = [x for x in votes if x >= total * (1/(4*m))]
if len(satisfied) >= m:
    print("Yes")
else:
    print("No")

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

vote = []
all = 0

for j in range(N):
    all += A[j]

for i in range(N):
    if A[i] >= all / (4 * M):
        vote.append(A[i])

if len(vote) >= M:
    print("Yes")

else:
    print("No")

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

Solution (Python):
s=input()
p=input()
l1=s.split()
l2=p.split()
N=int(l1[0])
M=int(l1[1])
A=[int(l2[n]) for n in range(0,N)]
count=0
for i in range(0,N):
    if A[i]>=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(reverse=True)
if A[M - 1] * 4 * M < sum(A):
    print("No")
else:
    print("Yes")

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

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

a.sort(reverse=True)

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

Solution (Python):
def solve(n, m, a):
    return "No" if sorted(a)[-m] < sum(a) / (4*m) else "Yes"

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

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

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

s = sum(a)

a.sort(reverse=True)

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

Solution (Python):

import sys
input = sys.stdin.readline

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

total = sum(a)
choosable = 0
for item in a:
    if item >= total / (4 * m):
        choosable += 1
    
if choosable >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
from math import ceil
n, m = map(int, input().split())
a = list(map(int, input().split()))
c = ceil(sum(a) / (4 * m))
d = 0
for e in a:
    if e >= c:
        d += 1
        if d == m:
            print('Yes')
            exit(0)
print('No')

Solution (Python):
n ,m = map(int, raw_input().split())
A = sorted(list(map(int, raw_input().split())), reverse = True)
divider = sum(A) / (4.0 * m) 

stack = 0

for a in A:
    if a >= divider:
        stack += 1

if stack >= m:
    print 'Yes'
else:
    print 'No'

Solution (Python):

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


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


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

Solution (Python):
import numpy as np
N, M = list(map(int,input().split()))
A = np.zeros(N)
A = list(map(int,input().split()))
ans = 'Yes'
A = np.sort(A)[::-1]
su = np.sum(A)
if A[M-1] < su / (4*M):
    ans = 'No'
print(ans)

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

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

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

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

else:
  print("No")

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

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

Solution (Python):
n,m=map(int,input().split())
arr=[int(x) for x in input().split()]
total = sum(arr)
ans=0
for item in arr:
	if item >= total/(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()))
counter = 0
border = sum(A)/(M*4)

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

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

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

A.sort(reverse=True)

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

else :
	print("No")

Solution (Python):

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

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

if len([a for a in A if a >= sum(A) / (4 * l[1])]) >= l[1]:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
NM_list = input().split(" ")
N = int(NM_list[0])
M = int(NM_list[1])
a_list = [int(num) for num in input().split(" ")]
a_list.sort(reverse = True)
sum_vote = 0
for i in a_list:
    sum_vote += i

for i in range(M):
    if a_list[i]*4*M<sum_vote:
        print("No")
        exit()
print("Yes")

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

count = 0
sum_total = sum(A)

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


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

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

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

if len([ s for s in scores if s >= at_least]) >= M:
  print('Yes')
else:
  print('No')

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

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

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

Solution (Python):


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

s = sum(a)
cnt = 0

for i in range(n):
    if a[i] * 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()))

l = sorted(a, reverse=True)

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

if b > l[m-1]:
    print("No")
else:
    print("Yes")

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

Solution (Python):

n,m = map(int, input().split())
List = list(map(int, input().split()))
listmx = sum(List)
cnt=0
for val in List:
    if val >=  listmx*1/m/4:
        cnt = 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 sum(A)/(4*M)<=A[M-1]:
  print("Yes")
else:
  print("No")

Solution (Python):

import sys
N, M = map(int, sys.stdin.readline().split())
A = list(map(int, sys.stdin.readline().split()))
A.sort(reverse=True)
S = sum(A)
for a in A[:M]:
    if a/S - 1/(4*M) <0:
        print('No')
        break
else:
    print('Yes')

Solution (Python):
n,m = map(int,input().split())
*l, = map(int,input().split())
s=sum(l)
ans = 'Yes'
count=0
for i in l:
  if i >=(s/(4*m)):
    count+=1
if count<m:
  ans='No'
print(ans)

Solution (Python):

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


import numpy as np
A = np.array(A)
B = np.sum(A)
C = A[A >= B/(4*M)]

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

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

Solution (Python):
N, M = [int(i) for i in input().split()]
A = [int(i) for i in 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")

Solution (Python):

import sys

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

main()

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

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

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

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

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

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

a.sort(reverse=True)

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

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

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

def main():
  n,m = readInts()
  a = readInts()
  s = sum(a)
  cnt = 0
  for i in range(n):
    if a[i]*4*m >= s:
      cnt+=1
  if cnt >= m:print("Yes")
  else:print("No")
if __name__ == '__main__':
  main()

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
def main():
  
  n,m = map(int,input().split())
  a = list(map(int,input().split()))
  
  cnt = 0
  SUM = 0
  for i in range(n):
    SUM += a[i]
  for i in range(n):
    if a[i] * (4*m) >= SUM:
      cnt+=1
  if cnt >= m:
    print('Yes')
  else:
    print('No')
  
if __name__ == '__main__':
  main()

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

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

counter = 0
for a in li_a:
    if a >= (s / (4 * m)):
        counter += 1
if m <= counter:
    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

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

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

num = sum(A_list)/(4*M)

A2_list = [s for s in A_list if s >= num]

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

Solution (Python):
from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

from heapq import heapify, heappush, heappop, heappushpop, heapreplace
from bisect import bisect_left, bisect_right

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

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

a_list = list(map(int, input().split()))
a_list.sort(reverse=True)

total_votes = sum(a_list)

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

Solution (Python):
def can_vote(A, m):
    if m == 1:
        return True
    A.sort()
    total = sum(A)
    tt = total * (1/(4*m))
    
    counter = 0

    for i in range(len(A)-1, -1, -1):
        if A[i] >= tt:
            counter += 1
        else:
            break
    if counter >= m:
        return True
    else:
        return False

n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
if can_vote(A, m):
    print("Yes")
else:
    print("No")

Solution (Python):
n, m = (int(i) for i in input().split());

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

cnt = 0;

s = sum(v);
for i in v:
    cnt += (4 * m * i >= s);

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

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

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

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

cnt = 0
ans = "No"
for ele in a:
	if ele >= lim : cnt += 1
	if cnt == m : ans = "Yes"; break

print(ans)

Solution (Python):


from sys import stdin, stderr

def check(M, A):
   A.sort()
   A = A[::-1]
   total = sum(A)
   for i in xrange(M):
      x = A[i]
      if x * 4*M < total:
         return False
   return True

def main():
   N, M = map(int, stdin.readline().split())
   A = map(int, stdin.readline().split())

   print('Yes' if check(M, A) else 'No')

   return 0

if __name__ == '__main__': main()

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

A.sort(reverse=True)

pickup = A[:M]

if min(pickup) < sum(A) * (1/(4*M)):
    print('No')
else:
    print('Yes')

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

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

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

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,m=INTM()
    a=LIST()
    suma=sum(a)
    ct=0
    for i in a:
        if 4*i*m>=suma:
            ct+=1
    if ct>=m:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    do()

Solution (Python):
n,m,*a=map(int,open(0).read().split())
print('YNeos'[len([i for i in a if sum(a)<=4*i*m])<m::2])

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):
if __name__ == "__main__":
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort()
    a.reverse()
    s = sum(a)
    if a[m-1] >= s/(4*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()]
print('No' if len([i for i in a if sum(a)/(4*m) <= i]) < m else 'Yes')

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

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

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

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

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

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

Solution (Python):
item_num, item_select = map(int, input().split())

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

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

Solution (Python):


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

a = sorted(a, reverse=True)
thresh = float(sum(a))/(4*m)

filtered = len(list(filter(lambda x: x >= thresh, a)))

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

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a,reverse=True)
A=[]
s=sum(a)
c=s/(4*m)
for i in range(m):
  if a[i]>=c:
    A.append(a[i])
print("Yes" if len(A)==m else "No")

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

aa = sum(a)

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

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

c = 0
for a in A:
    
    if 4*M*a >= V:
        c += 1

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

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
lim = sum(A) / (4*M)
count = 0
for a in A:
    if lim <= a:
        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)
sum_a = sum(a)

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


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

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

Solution (Python):
V=0;
o=input().rstrip().split(' ')
p=input().rstrip().split(' ')
S=0;
for i in range(0,len(p)):
    S+=int(p[i])
D=(1/(4*int(o[1])))*100;
p.sort(key=int,reverse=True)
for i in range(0,int(o[1])):
    G = (int(p[i])/S)*100;
    if G >= D:
        continue;
    else:
        V=1;
        break;

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

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

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

N, M = a[0], a[1]

sum = sum(A)

c = 0

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

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

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

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

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

Solution (Python):
url = "https://atcoder.jp/contests/abc161/tasks/abc161_b"


def main():
    n, m = list(map(int, input().split()))
    n_li = list(map(int, input().split()))
    n_li = sorted(n_li, reverse=True)
    all_num = sum(n_li)
    for i in range(1, m + 1):
        if all_num / (4 * m) > n_li[i - 1]:
            print('No')
            exit()
    print('Yes')


if __name__ == '__main__':
    main()

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

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

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

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

l_sum = sum(l)/(m*4)

if l[m-1] >= l_sum:
    print("Yes")
else:
    print("No")

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

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


l_sum = sum(l)/(m*4)

ans = 0
for i in range(m):
    if l[i] >= l_sum:
        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(reverse=True)
s = sum(a)
flag = True
for i in range(m):
    if a[i] < 1/(4*m)*s:
        flag = False
        break
if flag:
    print("Yes")
else:
    print("No")

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

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

if count >= m:
    ans = 'Yes'
else:
    ans = 'No'

print(ans)

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

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

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

tokuhyo_sum = sum(List)

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

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

Solution (Python):
str1 = input()
A = input()

list1 = str1.split()
list2 = A.split()
N = list1[0]
M = list1[1]

M_count = 0

all = 0
for i in range(len(list2)):
    all = all + int(list2[i])


judge =  1/(4*int(M)) * all


for i in list2:
    
    if int(i) >= judge:
        M_count = M_count + 1
        
    
if M_count >= int(M):
    print("Yes")
else:
    print("No")

Solution (Python):
N, M = map(int, input().split())
num = list(map(int, input().split()))
total = sum(num)
ans = []

for i in num:
    if total/(4*M) <= i:
        ans.append(i)

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

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

a.sort(reverse=True)

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

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

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

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

if __name__ == "__main__":
    main()

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