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

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

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

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

Solution (Python):
from sys import stdin, stdout

def solve(a,M):
    total = sum(a)
    a.sort(reverse = True)
    
    if a[M - 1]*4*M >= total: return 'Yes'
    return 'No'



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

stdout.write(solve(a,M))

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

X = sum(Li) / (4*M)
Li.sort(reverse = True)

if Li[M - 1] >= X:
    print("Yes")
else:
    print("No")

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

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

a = sorted(list(map(int, input().split())), reverse=True)

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

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

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

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


votes = 1 / (4 * M)



Total_votes = sum(product)

for p in product:
    if p / Total_votes >= votes:
        M -= 1
    if M == 0:
        break

if M <= 0:
    print('Yes')
else:
    print('No')

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

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

flag = 1

lim = 1/(m*4)*sum(nlist)

for i in range(m):
    if nlist[i] >= lim:
        pass
    else:
        flag = 0
        
if flag:
    print("Yes")
else:
    print("No")

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




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

b = [i for i in a if i >= x]

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

b = [i for i in a if i >= x]

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

Solution (Python):
if __name__ == '__main__':
    n, m = map(int, input().split())
    a = [int(i) for i in input().split()]
    s = sum(a)
    a = sorted(a)[::-1]
    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()))
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())
As = list(map(int, input().split()))
s = sum(As)
bs = [not A*4*M < s  for A in As]
if bs.count(True) >= M:
  print("Yes")
else:
  print("No")

Solution (Python):
import sys

import math
from fractions import Fraction
import itertools

input=sys.stdin.readline

n,m=map(int,input().split())
a=list(map(int ,input().split()))
s=sum(a)
s=s/(4*m)
c=0

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

Solution (Python):

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, M = lr()
A = np.array(lr())
total = A.sum()
A *= 4 * M
A = A[A>=total]
bl = len(A) >= M
print('Yes' if bl else 'No')

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


'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''

n,m=map(int, input().split())
a=list(map(int, input().split()))
a.sort()
v=sum(a)
cnt=0

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

count = 0

a.sort(reverse=True)
sum_a = sum(a)
thresh = sum_a * (1/(4*m))

for i in range(m):
    if a[i] >= thresh:
        count += 1
    else:
        break

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

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

TB = sum(A)
count = 0

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

if count < M:
    print('No')
else:
    print('Yes')

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

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

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

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

sums = sum(a)
count = 0

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

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

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

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

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

s = sum(a)

ok = [a[i]*4*m >= s for i in range(n)]

print("Yes" if ok.count(True) >= m else "No")

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

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

total = sum(A)

bodor = total / (4 * M)
cnt = 0

for i in A:
    if i >=  bodor:
        cnt += 1

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

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

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

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

Solution (Python):

N, M = [int(_) for _ in input().split()]
A = [int(_) for _ in input().split()]
P = [a for a in A if a >= (sum(A)/(4 * M))]
if len(P) >= M:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys

def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())

n, m = ISI()
l = ILI()
cnt = 0
s = sum(l)
for a in l:
	if a >= s/(4*m): cnt +=1
if cnt<m:print("No")
else:print("Yes")

Solution (Python):
n,m=map(int,input().split())
ai=list(map(int,input().split()))
bi=[i for i in ai if i>=sum(ai)/(4*m)]
if len(bi)>=m:
    print("Yes")
else:
    print("No")

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

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

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

A.sort(reverse=True)

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

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
A = sorted(A, reverse=True)
fav = sum(A) / (4 * M)
ans = 'Yes'

for i in range(M):
    if A[i] < fav:
        ans = 'No'
        break
print(ans)

Solution (Python):
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
all = sum(A)
L = len(A)
for a in A:
  if all / (4 * M) > a:
    L -= 1
  else:
    break
print("Yes" if L >= M else "No")

Solution (Python):
list = input().split()
vote_list = input().split()
is_accepted = True

sum = 0
for i in range(int(list[0])):
  sum += int(vote_list[i])

counter = 0
ave = 1/(4*int(list[1]))
for i in range(int(list[0])):
  if( int(vote_list[i]) < sum * ave):
    continue
  else:
    counter +=1
    
if counter >= int(list[1]):
  print("Yes")
else:
  print("No")

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

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

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

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

        ans = False
        total = 0

        A_sum = sum(A)
        threshold = A_sum/4/M

        for i in range(N):
                if A[i]>=threshold:
                        total += 1
                if total==M:
                        ans = True
                        break

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


if __name__=="__main__":
        main()

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

total = sum(A)

def check(score):
    return (True if score >= (total/(4*M)) else False)

cnt = 0
for i in range(N):
    if check(A[i]):
        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)*1.0) / (4 * M)

count = 0
for i in A:
  count += 1 if i >= S else 0

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

Solution (Python):
import numpy as np
n, m = [int(i) for i in input().split()]
a = np.array([int(i) for i in input().split()])
aa = a/(np.sum(a))
aa -= 1/(4*m)
flag = 0
aa = np.sort(aa)[::-1]

for i in range(n):
    if aa[i] < 0:
        flag += 0
    elif aa[i] >= 0:
        flag += 1

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

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

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

s = sum(l)

nl=sorted(l,reverse=True)



r = s/(4*m)

count=0

for i in range(m) :
    if nl[i]>=r:
        pass
    else :
        count += 1

if count > 0:
    print("No")
else :
    print("Yes")

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

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

s = sum(l)

nl=sorted(l,reverse=True)



r = s/(4*m)

count=0

for i in range(m) :
    if nl[i]>=r:
        pass
    else :
        count += 1

if count > 0:
    print("No")
else :
    print("Yes")

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

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):
import sys
input = sys.stdin.readline

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

votes = list(map(int, input().rstrip().split()))
ans = []

for i in range(len(votes)):
  if votes[i] >= sum(votes) / (4*M):
    ans.append(votes[i])

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

Solution (Python):
import numpy as np
n,m = map(int,input().split())
a = list(map(int,input().split()))
s = sum(a)
x = s*(1/(4*m))
aa = np.array(a)
if np.count_nonzero(aa >=x) >= m:
  print("Yes")
else:
  print("No")

Solution (Python):
N, M = map(int,input().split())
l = list(map(int,input().split()))
 
T = sum(l)
V = 1/(4*M) * T
S = len(list(filter(lambda x: x>=V, l)) )
 
print( "Yes" if S >= M else "No" )

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

items = [int(a) for a in input().split(' ')]

selected = 0

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

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

Solution (Python):
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    limit = sum(a) / (4 * m)
    count = 0
    for i in range(n):
        if a[i] >= limit:
            count += 1
    if count >= m:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

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

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


cnt = 0

for i in range(n):
  if a[i] >= total/4/m:
    cnt += 1

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

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

ans = 0
for i in range(N):
    if A[i] >= sum(A)*Fraction(1,4*M):
        ans += 1
    else:
        continue

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

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
votes = sum(A)
res = "Yes"

A.sort(reverse=True)

for i in range(1, M+1):
    if A[i-1] < (votes / (4 * M)):
        res = "No"
        break

print(res)

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

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

Solution (Python):

n, m = [int(_) for _ in input().split()]
a = [int(_) for _ in input().split()]
total = sum(a)
th = 1 / (4 * m) * total
import numpy as np
A = np.array(a)
A_sorted = A.argsort()[::-1]

if A[A_sorted[m - 1]] < th:
    print("No")
else:
    print("Yes")

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



if count==0:
    print("Yes")

else:
    print("No")

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

T = sum(l)
V = 1/(4*M) * T
S = len(list(filter(lambda x: x>=V, l)) )

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

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

c = 0

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

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

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

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

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

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

a=list(map(int, input().split()))
b=[0 for i in range(n)]
s=sum(a)

for i in range(n):
    if a[i]>= s/(4*m):
        b[i]=1

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

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

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

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

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

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

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

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

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

Solution (Python):


def f(m, a):
    poll = sum(a)
    result = [i for i in a if i >= poll/4/m]
    print('Yes' if len(result) >= m else 'No')

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

Solution (Python):
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

sum_A = A.sum()
select_num = sum_A * (1/(4*M))
A = A // select_num
ans = 0
for i in range(len(A)):
  if A[i] < 1:
    A[i] = 0
  else:
    A[i] = 1

print('Yes' if A.sum() >= M else 'No')

Solution (Python):
def solve(string):
    n, m, *a = map(int, string.split())
    return "No" if len([_a for _a in a if _a >= sum(a) / 4 / m]) < m else "Yes"


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Solution (Python):
def main():
    N, M = list(map(int, input().split()))
    A = list(map(int, input().split()))
    av = sum(A) / (4 * M)
    print("Yes" if len([x for x in A if x >= av]) >= M else "No")

if __name__ == '__main__':
    main()

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

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

X = sum(A) / (4 * List[1])

c = 0
for i in range(0,List[0]):
    if A[i] >= X:
        c += 1

if c >= List[1]:
    print('Yes')
else:
    print('No')

Solution (Python):



import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf



import math

import bisect


if __name__ == '__main__':
    n, m = list(map(int, input().split()))
    a_s = list(map(int, input().split()))

    threshold = sum(a_s) / (4 * m)
    count = 0
    for a in a_s:
        if a < threshold:
            continue
        count += 1
    
    
    if count >= m:
        print("Yes")
    else:
        print("No")

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

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

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

s = sum / 4 / m
ans = 0
for i in A:
    if int(i) >= s:
        ans += 1

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

Solution (Python):
if __name__ == "__main__":
    N, M = map(int, input().split())
    As = list(map(int, input().split()))
    As.sort(reverse=True)

    yes = True
    threshold = sum(As) / (4*M)
    for idx in range(M):
        if As[idx] < threshold:
            yes = False
            break
    
    if yes:
        print("Yes")
    else:
        print("No")

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

l = input().split(" ")
s = 0
for  i in l:
  m = int(i)
  s = s + m
 
q = s/(4*p)

c = 0
for i in l:
  m = int(i)
  if m >= q:
    c = c + 1
if c >= p:
  print("Yes")
else:
  print("No")

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

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

main()

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

Solution (Python):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n,m=map(int,stdin.readline().split())
a=list(map(int,stdin.readline().split()))
s=sum(a)
ans=0
for i in a:
    if(i<(s/(4*m))):
        continue
    ans+=1
if(ans>=m):
    print("Yes")
else:
    print("No")

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

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

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

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

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

ans = 0

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

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

Solution (Python):
import math
n,m=map(int,input().split())
a=list(map(int,input().split()))
s=sum(a)
t=math.ceil(s/4/m)
a.sort()

cnt=0
for i in a:
  if i>=t:
    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()))

list_A = sorted(list_A, reverse=True)

total_vote = sum(list_A)

if M > len(list_A):
    answer = 'No'
elif (list_A[M -1] / total_vote) < 1/(4*M):
    answer = 'No'
else:
    answer = 'Yes'

print(answer)

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

th=sum(a)/(m*4)
ans=[val for val in a if val >= th]

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

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


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)

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()))
b = 0
s = sum(a)

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

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
hyou = [0] * N
sou = 1/(4*M)
total = sum(A)
for i, a in enumerate(A):
    if a >= total*sou:
        hyou[i] = 1
if sum(hyou) >= M:
    print("Yes")
else:
    print("No")

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

A_sum = sum(A)
evo = A_sum/(4*M)

counter = 0
for vote in A:
    if vote >= evo:
        counter += 1

if counter < M:
    print('No')
else:
    print('Yes')

Solution (Python):
import numpy as np

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

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

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

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


A = sorted(A)[::-1]
total = sum(A)

OK = True
for i in range(M):
    if (A[i] * 4 * M) < total:
        OK = False

if OK:
    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)*1/4/M):
        count+=1

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

Solution (Python):
n, m = list(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)
suma = sum(a)
a = [i / suma for i in a]
flag = True
for i in range(m):
    if a[i] < 1/(4*m):
        flag = False
        break

print('Yes') if flag else print('No')

Solution (Python):
from functools import reduce

N, M = map(int, input().split())
A = list(map(int, input().split()))
all_A = sum(A)
valid_A = list(filter(lambda x: x >= all_A/4/M, A))
if len(valid_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)
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()))

s = []
for i in a:
    if i >= (sum(a)/(4*m)):
        s.append(1)
    else:
        s.append(0)

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

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

kei = sum(a)
ans = 0
line = kei / 4 / m
for i in a:
    if i >= math.ceil(line):
        ans+= 1
if ans>=m:
    print('Yes')
else:
    print('No')

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

lim = 1/(4*m)

ans = 0
for a in A:
  a /= sum(A)
  if a>=lim:
    ans += 1
    
if ans >= m:
  print("Yes")
else:
  print("No")

Solution (Python):
import itertools
import math
import fractions
import functools
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()))

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

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

Solution (Python):
import sys
import math
import bisect

def main():
    n, m = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort(reverse=True)
    total = sum(A)
    
    ans = True
    for i in range(m):
        if A[i] * 4 * m < total:
            ans = False
            break
    if ans:
        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)
sum=0
for a in A:
    sum+=a


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

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

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

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

for i in range(M):
    if A[i] < border:
        print('No')
        break
else:
    print('Yes')

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
    else:
        pass

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

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

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

    count = 0
    sum = 0

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

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

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

    ABC_161_B()

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

Solution (Python):

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


Alist = sorted(list(map(int,input().split())),reverse=True)


if Alist[M-1] / sum(Alist) >= 1 / 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 = num + 1
    if num >= m:
        print("Yes")
        exit()
print("No")

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

Solution (Python):
import heapq

N, M = map(int,input().split())
a = list(map(int,input().split()))
count = 0

for i in heapq.nlargest(M,a):
    if(1 / (4 * M) <= i / sum(a)):
        count += 1

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

Solution (Python):
import heapq

N, M = map(int,input().split())
a = list(map(int,input().split()))
count = 0

for i in heapq.nlargest(M,a):
    if(1 / (4 * M) <= i / sum(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()))
judge = sum(A) / (4 * M)

L = [i for i in A if i >= judge]

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

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
s=[]
M=sum(a)*(1/4/m)
for i in a:
    if i>=M:
        s.append(i)

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

Solution (Python):
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())),reverse=True)
t = 0
for i in range(n):
    t += a[i]

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