Problem:
 Score : 200 points    Problem Statement We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print Yes ; otherwise, print No .      Constraints  1 \leq M \leq N \leq 100  1 \leq A_i \leq 1000  A_i are distinct.  All values in input are integers.         Input Input is given from Standard Input in the following format:  N  M  A_1  ...  A_N       Output If M popular items can be selected, print Yes ; otherwise, print No .        Sample Input 1 4 1
5 4 2 1      Sample Output 1 Yes  There were 12 votes in total. The most popular item received 5 votes, and we can select it.       Sample Input 2 3 2
380 19 1      Sample Output 2 No  There were 400 votes in total. The second and third most popular items received less than \dfrac{1}{4\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.       Sample Input 3 12 3
4 56 78 901 2 345 67 890 123 45 6 789      Sample Output 3 Yes

Solution (Python):

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


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


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

    total = sum(A)
    c = 0
    for a in A:
        c += a * 4 * M >= total

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


def main():
    solve()


if __name__ == '__main__':
    main()

Solution (Python):

n, m, *a = map(int, open(0).read().split())
s = sum(a)
print("YNeos"[sum(i * 4 * m >= s for i in a) < m::2])

Solution (Python):
n,m = map(int,input().split())
a = list(map(int,input().split()))
b = sum(a)
cnt = 0
for i in a:
    if i >= b/(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=sorted(A,reverse=True)[m-1]
t=sum(A)//(4*m)

if sum(A)%(4*m)!=0:
    if s>t:
        ans='Yes'
    else:
        ans='No'
else:
    if s>=t:
        ans='Yes'
    else:
        ans='No'
print(ans)

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
if cnt >= m:
    print('Yes')
else:
    print('No')

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

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

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

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

ans = 0
for i in A:
    if i >= threshold:
        ans += 1

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

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

newlist = sorted(a,reverse=True)

for i in range(m):
    if newlist[i] >= sum(a)*(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 = sorted(a, reverse=True)
s = sum(a)
if a[m-1] < s/(4*m): 
    print("No")
else:
    print("Yes")

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = sorted(a, reverse = True)
if b[m-1] >= sum(b) * (1 / (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()]
k=sum(a)
a.sort(reverse=True)
cont=0
ans=''
for i in a:
    if i>=k*(1/(4*m)):
        cont+=1
if cont>=m: print("Yes")
else: print("No")

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

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


border = total_voting / (4 * m)

ll = []
for i in l:
  if i >= border:
    ll.append(i)

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

Solution (Python):
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split(' ')))
    A.sort()
    A.reverse()
    total = sum(A)
    for i in range(M):
        if total / (4 * M) <= A[i]:
            continue
        print('No')
        return
    print('Yes')

main()

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

a.sort(reverse = True)
ans = 'Yes'

for i in range(m):
  if a[i] < sum(a) / (4 * m):
    ans = 'No'
    break

print(ans)

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

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

a.sort()
sum = 0;
for i in range(n):
    sum += a[i];
if a[n-m]*4*m >= sum:
    print('Yes');
else:
    print('No');

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

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

A = [a for a in A if a >= line]

print('Yes') if len(A) >= m else print('No')

Solution (Python):
N,M = (int(a) for a in input().split())
A = list(map(int,input().split()))
A = list(reversed(sorted(A)))
v = sum(A)
d = v / (4*M)
if A[M-1]  < d :
    print("No")
else :
    print("Yes")

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

v = sum(a)
x = 1 / (4 * m)
v = v * x

c = 0
for i in range(n):
    if a[i] < v:
        break
    else:
        c += 1

    if c == m:
        break

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

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

A.sort()
sum = 0
for i in range(N):
    sum += A[i]

for i in range(N):
    if N - i > N - M:
        if sum / (4 * M) > A[N-1-i]:
            print('No')
            exit()

print('Yes')

Solution (Python):
import math
N, M = map(int, input().split())
ans = 0
Nlist = list(map(int, input().split()))
total = sum(Nlist)
Mmin = math.ceil(total*1/(4*M))
ans = len([1 for x in Nlist if x >= Mmin])
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)
total = sum(A)
print('Yes' if A[M-1] >= total / (4 * M) else 'No')

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

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
print('NYoe s'[len([i for i in a if i>=sum(a)/4/m])>=m::2])

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

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

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

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

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

Solution (Python):
import numpy as np

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

vote_arr = np.array(vote_lists)
total_vote = vote_arr.sum()
is_popular = total_vote / (4 * m)

answer_lists = []

for i in vote_lists:
  if i >= is_popular:
    answer_lists.append(i)

if len(answer_lists) >= 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)

for i in range(N):
    if i == M - 1:
        if (s / (4 * M)) > A[i]:
            print('No')
        else:
            print('Yes')

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

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

for i in range(N):
    if i == M-1:
        if (s/(4*M))>A[i]:
            print('No')
        else:
            print('Yes')

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

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

for i in range(N):
    if i == M-1:
        if (s/(4*M))>A[i]:
            print('No')
        else:
            print('Yes')

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

sum_a = sum(a)
a = sorted(a)

cnt = 0
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())
list_A=list(map(int,input().split()))
sum_A=sum(list_A)
count=0
for i in range(N):
    if list_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)

atot = sum(a)
ans = 'Yes'
for i in range(m):
   if a[i] < atot/(4.0*m):
      ans = 'No'
      break
print(ans)

Solution (Python):
n = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
tot = sum(a)
count = 0
for i in a:
	if((i * 4 * n[1]) >= tot):
		count += 1
if(count >= n[1]):
	print('Yes')
else:
	print('No')

Solution (Python):
import sys
import itertools

import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines




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

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

ans = [a for a in A if a >= limit]
if len(ans) >= M:
    print("Yes")
else:
    print("No")

Solution (Python):
inp1, inp2 = map(int,input().split())
list = list(map(int,input().split()))
list.sort(reverse = True)
if list[inp2-1] >= (sum(list))/ (inp2 * 4):
    print("Yes")
elif list[inp2-1] < (sum(list))/ (inp2 * 4):
    print("No")

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

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

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

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

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

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

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

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

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

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

def vote(a,m):
  a.sort(reverse=True)
  if a[m-1] >= sum(a)/(4*m):
      return True
  else:
      return False
    
ans = "Yes" if vote(A,M) else "No"
print(ans)

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

a.sort(reverse = True)

count = 0

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

k = count/(4*m)

if a[m-1] < k:
  print("No")
else:
  print("Yes")

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

sum=sum(A_list)


for i in range(0,N):
    if A_list[int(i)] < sum / (4*M):
        A_list[int(i)]="Noooo"
    else:
        A_list[int(i)]="Yeeees"


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

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

total = sum(A)
count = sum(1 for x in A if 4 * M * x >= total)
if count >= M:
    print("Yes")
else:
    print("No")

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

Solution (Python):
arr = input().split()

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

n,m,count,sum = int(arr[0]),int(arr[1]),0,0

for i in arr2:
  sum += i
  

for i in arr2:
  if i >= sum/(4*m): count+= 1
    
if count >= m: print("Yes")
else: print("No")

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

Solution (Python):
N, M = map(int, input().split())
a_list = list(map(int, input().split()))
a_list = sorted(a_list)
 
cnt = 0
 
for i in range(N):
    if a_list[i] >= sum(a_list)/(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()))
sum = 0
num = 0

for j in range(len(a)):
    sum += a[j]

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


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

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

cnt = 0

for i in range(n):
    if a_list[i] >= sum(a_list)/(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()))
ans = 0

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

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

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

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

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

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

Solution (Python):
import math

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
total = sum(A)

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

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

Solution (Python):


def main():
    vote_list=[]
    n,m = map(int,input().split())
    vote_list=list(map(int,input().split()))
    ans=0

    for i in vote_list:
        if i >= sum(vote_list)/(4*m):
            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=sorted(a,reverse=True)
if a_sort[m-1]>=sum(a)*(1/(4*m)):
    print("Yes")
else:
    print("No")

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

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

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



def main():
    N, M = [int(i) for i in input().strip().split()]
    A_list = [int(i) for i in input().strip().split()]
    num = 0

    for i in range(N):
        if A_list[i] >= sum(A_list) / (4 * M):
            num += 1
        else:
            continue

    if num >= M:
        return "Yes"
    else:
        return "No"


if __name__ == "__main__":
    print(main())

Solution (Python):
import numpy as np
def cumsum(x):
    return list(np.cumsum(x))

def cumsum_number(N,K,x):
    ans=[0]*(N-K+1)
    number_cumsum = cumsum(x)
    number_cumsum.insert(0,0)
    for i in range(N-K+1):
        ans[i]=number_cumsum[i+K]-number_cumsum[i]
    return ans
"""
int 
float 


for name in fruits: 
    print(name)


list0 = [] 
list0 = [1,2,3,4] 
list0 = [0]*10 
list1= [i for i in range(10)] 
list1 = list(map(int, input().split()))　
number=[int(input()) for i in range(int(input()))] 
list1 = list1 + [6, 7, 8] 
list2.append(34) 
list.insert(3,10) 
len(list4) 
max(sa) 
list5.count(2) 
list1.sort() 
list1.sort(reverse=True)  
set(list1) 
sum([2,3,   ,3]) 

abs(a) 
max(a,b) min(a,b) 
text1 = text1.replace("34","test") 

exit(0) 

cumsum(リスト) 
cumsum_number(N,K,x) 
"""
N,M=map(int,input().split())
number=list(map(int,input().split()))
ans = 0
for i in number:
    if i>=sum(number)/(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()))
cnt = 0

for val in a:
  if val >= sum(a) / (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()))

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

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

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

t = sum(a)/(4*m)
a = sorted(a, reverse=True)
for i in range(n):
    if a[i] >= t:
        m -= 1

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

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

Solution (Python):
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
L=list(map(int,input().split()))
mx = sum(L)
mn = mx/(4*m)
L.sort(reverse = True)
count = 0
for i in range(n):
    if L[i]>=mn:
        count+=1
    if count ==m:
        print('Yes')
        sys.exit()
print('No')
sys.exit()

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

list.sort(hyou, reverse=True)

for i in range(n):
  sum += hyou[i]

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

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

A.sort(reverse=True)

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

Solution (Python):
n,m=list(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()))

pick = 0

for i in A:
  if i >= sum(A)/(4*M):
    pick += 1
    
if pick >= M:
  print("Yes")
else:
  print("No")

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

V = sum(A)
L = V/4/M

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

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

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

for i in range(n):
    if a[i]>=x:
        c+=1
if c<m:
    print('No')
else:
    print('Yes')

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

s = sum(A) / (4 * m)
cnt = 0
for a in reversed(sorted(A)):
    if a < s:
        break
    cnt += 1
    if cnt >= m:
        break

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

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

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

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

Solution (Python):
n , m = map(int,input().split())
a = list(map(int,input().split()))
can_choice_item_list =[]
for item in a:
  if item < sum(a) / (4 * m):
    pass
  else:
    can_choice_item_list.append(item)
if m <= len(can_choice_item_list):
  print('Yes')
else:
  print('No')

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

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

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

num = 0

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

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

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

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

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

Solution (Python):
n, m = list(map(int, input().split()))
goods = list(map(int, input().split()))
flag = 1
limit = float(sum(goods)) / (4 * m)
for i in range(n - 1):
  for j in range(n - i - 1):
    if goods[j] <= goods[j+1]:
      tmp = goods[j]
      goods[j] = goods[j+1]
      goods[j+1] = tmp
for i in range(1, m):
  if goods[i] < limit:
    flag = 0
    break
if flag:
  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 sys
import numpy as np
from collections import deque



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

g = np.array(g)




if np.count_nonzero(g >= 1/4/M*np.sum(g)) >= M:
    print('Yes')
else:
    print('No')

Solution (Python):
from sys import exit
N,M = map(int,input().split())

itemlist = [int(x) for x in input().split()]
itemlist.sort(reverse=True)

point = sum(itemlist)/(4*M)

for i in range(M):
    if itemlist[i] < point:
        print('No')
        exit(0)

print('Yes')

Solution (Python):
n,m=map(int,input().split())
A=sorted(list(map(int,input().split())))[::-1]
vote_min=sum(A)*(1/(4*m))
prod_popular=0
ans="No"
for a in A:
    if a>=vote_min:
        prod_popular+=1
    if prod_popular==m:
        ans="Yes"
print(ans)

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

if select == 1:
    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] >= 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_sum=sum(a)
a_sort=sorted(a,reverse=True)
for i in range(m):
  if a_sort[i]<(a_sum)/4/m:
    print("No")
    break
else:
  print("Yes")

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

As = sorted(A,reverse=True)

flag = 0
for x in range(M):
    if As[x] < sum(A)/4/M:
        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()))
b = sum(A)/(4*m)
a = 0

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

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

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

if __name__ == "__main__":
    main()

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

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

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

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

f()

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
a_sum = sum(a)
ans = 'Yes'
for i, c in enumerate(a[:m]):
    if c < a_sum / (4 * m):
        ans = 'No'

print(ans)

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


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

a_sum = sum(a)
judge = a_sum/(4*m)

count = 0
for i2 in [i for i  in a if i >= judge]:
  count+=1

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

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

else:
  print("Yes")

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

l = list(map(int,input().split()))
s = sum(l)
ans = 0
t = s/(4*m)

for i in l:
  if i>=math.ceil(t):
    ans+=1
  
if ans>=m:
  print("Yes")
else:
  print("No")

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

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

all_A = sum(A)
border = all_A / (M*4)

select = 0

for a in A:
    if a >= border:
        select += 1

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

Solution (Python):

n, m, *a = map(int, open(0).read().split())
c = sum(a)*0.25/m
for i in a:
    if i >= c:
        m -= 1
if m <= 0:
    print('Yes')
else:
    print('No')

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

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

A.sort(reverse = True)



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

else:
    print("Yes")

Solution (Python):


import sys
input=sys.stdin.readline

def main():
    n,m=map(int,input().split())
    A=list(map(int,input().split()))
    cnt=0
    suma=sum(A)
    for i in range(n):
        if A[i]>=suma/(4*m):
            cnt+=1
    if cnt>=m:
        print("Yes")
    else:
        print("No")
    
    
    
if __name__=="__main__":
    main()

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

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

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
c = 0
for i in A:
    if 4 * M * i >= sum(A):
        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()))
total = sum(A)
ans = []
for n in A:
    if 4*M*n < total:
        pass
    else:
        ans.append(n)
if len(ans) >= M:
    print('Yes')
else:
    print("No")

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

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

if __name__ == '__main__':
    solve()