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 = [int(x) for x in input().split()]
total = sum(a)
count = sum(1 for x in a if x >= total / (4*m))
print('Yes' if count >= m else 'No')

Solution (Python):


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

total = sum(A)
count = 0

for a in A:
  if a >= 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()))
total = sum(A)
print('Yes' if M <= len(list(filter(lambda x: x, map(lambda x: x * 4 * M >= total, A)))) else 'No')

Solution (Python):

from collections import defaultdict, deque, Counter, OrderedDict
from functools import reduce, lru_cache
import collections, heapq, itertools, bisect
import math, fractions
import sys, copy

sys.setrecursionlimit(1000000)

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline().rstrip())
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline().rstrip())
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def LIR1(n): return [LI1() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]

dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007

def main():
    N, M = LI()
    A = LI()
    s = sum(A)

    print("Yes" if len(list(filter(lambda x: 4 * M * x >= s, A))) >= M else "No")


if __name__ == '__main__':
    main()

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

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
cr = sum(A) / (4*M)
Arev = sorted(A, reverse = True)

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

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

total = sum(A)
A.sort(reverse=True)
if A[M-1] >= total / (4*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)
cnt=0

for i in range(N):
    if A[i] >= th:
        cnt+=1
if cnt >=M:
    print('Yes')
else:
    print('No')

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

votes = sum(A)
A.sort(reverse=True)
if A[m-1] < votes/(4*m):
  print('No')
else:
  print('Yes')

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

print('Yes') if sum(A) / (4 * M) <= sorted(A, reverse=True)[M -1] else print('No')

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n, m = M()
li = LI()
li.sort(reverse=True)
S = sum(li)
if li[m-1] >= S / (4*m):
    print('Yes')
else:
    print('No')

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

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

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

Solution (Python):
a,b=map(int,input().split())
List = list(map(int, input().split()))
wa = 0
List.sort(reverse = True)
for i in range(a):
  wa += List[i]
thresi = wa / (4 * b)
flag = False
for i in range(b):
  if List[i] >= thresi:
    flag = True
  else:
    flag = False
if flag:
  print("Yes")
else:
  print("No")

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

Mth_got_vote = vote_list[M - 1]

if Mth_got_vote < sum(vote_list) / (4 * M):
    print("No")
else:
    print("Yes")

Solution (Python):
n,m=map(int,input().split());a=sorted(map(int,input().split()),reverse=True)
print('NYoe s'[all([1 if i>=sum(a)/(4*m) else 0 for i in a[:m]])::2])

Solution (Python):
n,m=map(int,input().split());a=sorted(map(int,input().split()),reverse=True)
print('NYoe s'[all([1 if i>=sum(a)/(4*m) else 0 for i in a[:m]])::2])

Solution (Python):
n,m=map(int,input().split());a=sorted(map(int,input().split()),reverse=True)
print('NYoe s'[all([1 if a[i]>=sum(a)/(4*m) else 0 for i in range(m)])::2])

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

result = popular_vote()
print(result)

Solution (Python):


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

A.sort(reverse = True)
border = sum(A) / (4 * M) 
cnt = 0
for a in A:
  if a >= border:
    cnt += 1
  else:
    break

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

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

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

print("Yes") if all(e >= votes/(4*m) for e in a[:m]) else print("No")

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

cnt = 0
th = sum(A)/(4*M)

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

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

Solution (Python):
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
総投票数 = sum(a)
x = 総投票数 / (4 * m)
for i in range(m):
    if a[i] < x:
        flag = 0
        break
else:
    flag = 1
print(["No", "Yes"][flag])

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

b = [x for x in a if x >= sum(a)/4/m]

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

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

a_list.sort(reverse=True)


standard=sum(a_list)/(4*m)



if a_list[m-1]<standard:
    print("No")
    
else:
    print("Yes")

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

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

print(['No','Yes'][count >= m])

Solution (Python):
import numpy as np
n,m = map(int, input().split())
a = np.array([int(i) for i in input().split()])
ans = (a >= a.sum()/(4*m)).sum()
if ans >= m:
    print('Yes')
else:
    print('No')

Solution (Python):

import sys
import collections as cl


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


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


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


def main():
    N, M = MI()
    A = LI()

    shre = sum(A) / (4 * M)
    ans = 0
    for a in A:
        if a >= shre:
            ans += 1
    print("Yes" if ans >= M else "No")


main()

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

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

sum_A = sum(A) / 4 / m
cnt = 0

for i in A:
  if i >= sum_A:
    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=0
for i in A:
    a+=i
b=a/(4*M)
c=0
for n in range(0,N):
    if A[n]>=b:
        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=0
for i in A:
    a+=i
b=a/(4*M)
c=0
for n in range(0,N):
    if A[n]>=b:
        c+=1
if c>=M:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

s = sum(a)
t = (s + (4 * m - 1)) // (4 * m)

cnt = 0
for i in a:
    if t <= i:
        cnt += 1

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

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

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

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

for i in range(M):
  if A[i] < sum_voted / (4 * M):
    print("No")
    exit(0)

print("Yes")

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, M, *A = map(int, read().split())

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

    return


if __name__ == '__main__':
    main()

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

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

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

for i in a[:M]:
    if i < z/4/M:
        print('No')
        break
else:
    print('Yes')

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

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

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

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

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

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


if __name__ == '__main__':
    main()

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

s = sum(a) * (1 / (4 * m))

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

a_thr = sum(a) / (4 * m)
count = 0
for a_i in a:
    if a_i >= a_thr:
        count += 1
print('Yes' if count >= m else 'No')

Solution (Python):
N,M=map(int,input().split())
A=list(map(int,input().split()))
s=sum(A)
A.sort(reverse=True)
t=0
for x in range(M):
  if A[x]*4*M<s:
    t=1
    break
if t==0:
  print("Yes")
else:
  print("No")

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

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

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

Solution (Python):
import sys


def solve(m, a, s):
    for i in range(m):
        if a[i] * 4 * m < s:
            return False
    return True


def main():
    input = sys.stdin.buffer.readline
    _, m = map(int, input().split())
    a = sorted(map(int, input().split()), reverse=True)
    s = sum(a)
    print('Yes' if solve(m, a, s) else 'No')


if __name__ == '__main__':
    main()

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

Solution (Python):
N,M = [int(hoge) for hoge in input().split()]
A = [int(hoge) for hoge in input().split()]
S = sum(A)
kijun = (S-1)//(4*M)
X = (sum([a>kijun for a in A]))
if X < M:
    print("No")
else:
    print("Yes")

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
total = sum(A)
thre = total / (4 * M)

for a in A:
    if a < thre:
        break
    ans += 1

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

Solution (Python):
N,M=map(int,input().split())
K=list(map(int,input().split()))
L=sorted(K)
S=0
for i in range(N):
  S+=L[i]
if L[N-M]*4*M<S:
  print("No")
else:
  print("Yes")

Solution (Python):
n,m = map(int,input().split())
a = sorted(list(map(int,input().split())),reverse=True)
b = sum(a)/(4*m)
c=[]
for i in a[:m]:
  if i >= b:
    c.append(i)

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

Solution (Python):
N, M = map(int, input().split())
aaa = list(map(int, input().split()))
acc = sum(aaa)
print('Yes' if sum(4 * M * a >= acc for a in aaa) >= M else 'No')

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

minval = sum(pop) / (4 * m)

nqual = sum(1 for p in pop if p >= minval)

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

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

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

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

x = 0
for i in a:
    if i * 4 * m >= sum:
        x += 1


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

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

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

s = sum(A)
th = s * 1/(4*M)

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

Solution (Python):
import sys

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

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:
  ans="Yes"
else:
  ans="No"
  
print(ans)

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

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
a.sort()
a = a[::-1]

print('Yes' if s <= 4 * m * a[m - 1] else 'No')

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

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

vote = sum(a)

a.sort()
b = a[::-1]

for i in range(m):
    if b[i] * 4 * m < vote:
        print('No')
        exit()
        
print('Yes')

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

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

Solution (Python):
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('Yes')
else:
  print('No')

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




def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
	n,m=MI()
	A=LI()
	A.sort(reverse=True)
	S=sum(A)


	ans="Yes"

	for i in range(m):
		if A[i]*4*m<S:
			ans="No"
			break

	print(ans)
















if __name__ == "__main__":
	main()

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

d = sum(c)
e = sorted(c,reverse=True)

for i in range(b):
  if(e[i]<d/(4*b)):
    print("No")
    exit()
print("Yes")

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

if M<=sum(T<=a for a in A):
  print("Yes")
else:
  print("No")

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

for i in range(M):
    if sum(a)%(M*4)== 0:
        if a[i] >= int(sum(a)/(M*4)):
            b += 1 
    if sum(a)%(M*4)!= 0:
        if a[i] > int(sum(a)//(M*4)):
            b += 1 
if b == M:
    print('Yes')
elif b < M:
    print('No')

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

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter
import decimal
import re











import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,m = readInts()
A = readInts()
sumA = sum(A)
div = sumA * (1/(4*m))
A = sorted(A,reverse=True)
for i in range(m):
    if A[i] < div:
        print('No')
        exit()
print('Yes')

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

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

Solution (Python):






import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
n,m=MI()
lis=LI()
u=sum(lis)
count=0
lis.sort(reverse=True)
for i in range(n):
    if (4*m)*lis[i]>=u:
        count+=1
if count>=m:
    print("Yes")
else:
    print("No")

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

vote = sum(a)
a.sort(key=lambda x: -x)

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

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

Solution (Python):
a, b = map(int, input().split())
c = list(map(int, input().split()[:a]))
c.sort(reverse = True)
d = c[:b]
e = 0
for i in d:
    if i >= ((1/(4*b))*sum(c)):
        e += 1
if e==b:
    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 = input().split()
a = list(map(int, input().split()))
b = []
s = 0

for i in a:
    s += i

for i in a:
    if float(i) >= float(int(s)/(4*int(m))):
        b.append(i)
        if len(b) == int(m):
            break

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

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

check = sum(an)/(4*m)
count = 0

for a in an :
  if a >= check:
    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)
for i in range(N):
  if i < M and A[i] < sum(A) / (4 * M):
    print("No")
    exit()
print("Yes")

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

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

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse = True)
num = 0
for i in A:
    num += i
if A[M-1] >= num/(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('Yes')
else:
    print('No')

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
a_sort=[]
a_sort=sorted(a,reverse=True)
sum=0
for i in a:
  sum+=i
b_sort=a_sort[0:m]
for j in b_sort:
 if j<sum/(4*m):
    print("No")
    exit()
print("Yes")

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

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

for i in range(M):
    if A[i] < total/(4*M):
        print('No')
        flag = False
        break

if(flag):
    print('Yes')

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

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

a_desc = sorted(A, reverse=True)

for i in range(M):
    if a_desc[i] < dl:
        print("No")
        break
else:
    print("Yes")

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

total = sum(A)
A.sort(reverse=True)
if A[M-1] < total / (4*M):
    print('No')
else:
    print('Yes')

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

Solution (Python):

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

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

A = sorted(A, reverse=True)

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

Solution (Python):

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

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

A = sorted(A, reverse=True)

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

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

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

for i in range(len(A)):
  C += A[i]
  
for i in range(len(A)):
  if A[i] >= C/(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()))

total=0
a.sort(reverse=True)
for i in range(n):
    total+=a[i]


ans=1
for i in range(m):
    if a[i]<1/4/m*total:
        ans=0
        break
if ans==1:
    print("Yes")
else:
    print("No")

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

x = sorted(lstA)[-M] 

if(x >= (sum(lstA) * 1) / (4 * M)):
  print("Yes")
else:
  print("No")

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

sum_a=sum(a)
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):
import math  
from typing import Dict, List, Optional, Tuple, Union  


def main(N: int, M: int, A: List[int]):
    x = sum(A) * 1 / (4 * M)
    chooseables: List[bool] = [a >= x for a in A]
    print(["No", "Yes"][sum(chooseables) >= M])


if __name__ == "__main__":
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    main(N, M, A)

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

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

print('Yes' if count >= m else '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) * (1 / (4 * M)):
    print("No")
else:
    print("Yes")

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

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

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

Solution (Python):
from sys import exit

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

vote = sum(A)

count = 0
for a in A:
    if a * 4 * M >= vote:
        count += 1
        if count == M:
            print('Yes')
            exit()

print('No')

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

B = [1 for a in A if a >= (sum(A)-1)//(4*M)+1]

if sum(B) >= M:
    print("Yes")
else:
    print("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 = list(map(int, input().split()))
a = list(map(int, input().split()))

sum_a=sum(a)

if sum_a/(M*4) > float(sorted(a)[::-1][M-1]):
  print("No")
else:
  print("Yes")

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

for i in range(1,m+1):
    if A[-i]<0.25*sum(A)/m:
        print('No')
        exit()
print('Yes')

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

A_sum = sum(A)

this_or_more = A_sum/(4*M)

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

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

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

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse =True)
minimum = sum(A)/(4*M)
count = 0
for i in range(M):
    a = A.pop(0)
    if a < minimum:
        count = 1
if count == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
import math
N,M = map(int,input().split())
A = list(map(int,input().split()))
SUM = sum(A)
ans = 0
for i in range(N):
	if A[i] >= math.ceil(SUM/4/M):
		ans +=1
if ans >= M:
	print("Yes")
else:
	print("No")