peterverebics/CodeNet_Python_118 huggingface dataset:
N, M = map(int, input().split())
A = list(map(int, list(input().split())))

A.sort(reverse=True)

if A[M - 1] >= sum(A) / (4 * M): print('Yes')
else : print('No')
n,m=map(int,input().split())
a=list(map(int,input().split()))
c=sum(a)
count=0
for i in range(n):
  if a[i]*4*m>=c:
    count+=1
if count>=m:
  print('Yes')
else:
  print('No')
n, m = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
total = sum(A)
limit = total / (4*m)

for i in range(m):
    a = A.pop()
    if a < limit:
        print('No')
        exit()

print('Yes')
N, M = map(int, input().split())

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

count = 0

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

if count >= M:
    print('Yes')
else:
    print('No')
N,M=map(int,input().split())
A=list(map(int,input().split()))
ans=[]
border=sum(A)/(4*M)

for i in A:
    if i>=border:
        ans.append(i)
    else:
        pass
print("Yes" if len(ans)>=M else "No")
from fractions import Fraction

N,M = map(int,input().split())
A = sorted(list(map(int,input().split())))
vote_num = sum(A)
ans = 0
x = Fraction(1, 4*M)

for i in A:
        if i >= vote_num*x:
                ans += 1

if ans >= M:
        print("Yes")
else:
        print("No")
a,b=map(int,input().split())
l=sorted(list(map(int,input().split())))
l.reverse()
m=l[0:b]
t='Yes'
for i in m:
    if i<sum(l)*(1/(4*b)):
        t='No'
        break
print(t)
n,m = map(int,input().split())
A = list(map(int,input().split()))
ans = 0
t = sum(A)
for i in range(n):
    if A[i] < t/(4*m):
        None
    else:
        ans += 1
if ans >= m:
    print('Yes')
else:
    print('No')
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    assert N == len(A)
    votes = sum(A)
    count = 0
    for i in A:
        if i * 4 * M >= votes:
            count += 1
    print("Yes") if count >= M else print("No")


if __name__ == '__main__':
    main()
# -*- coding: utf-8 -*-
# 整数の入力
# a = int(input())
# スペース区切りの整数の入力
# b, c = map(int, input().split())
# 文字列の入力
# s = input()
# 出力
# print("{} {}".format(a+b+c, s))
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("Yes")
else:
    print("No")
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')
n,m = map(int, input().split())
l = list(map(int, input().split()))
c = 0
for index in l:
  if index >= sum(l)/(4*m):
    c += 1
print("Yes" if c >= m else "No")
N,M=list(map(int,input().split()))
A=list(map(int,input().split()))
sum=sum(A)

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

ans = 0

for ai in a:
    if (4 * m * ai >= sum(a)):
        ans += 1

if ans >= m:
    print("Yes")
else:
    print("No")
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,m = mi()
ali = li()

summ = 0
for i in range(n):
    summ += ali[i]

ki = summ / 4/ m
ans = 0
for i in range(n):
    if ali[i] >= ki:
        ans += 1
if ans >= m:
    print("Yes")
else:
    print("No")
n,m= map(int,input().split())
a = list(map(int,input().split()))
s=sum(a)
ans=[]
a=sorted(a,reverse=True)
for i in range(m):
  if a[i]*4*m >= s:
    ans.append(a[i])

if len(ans) == m:
  print("Yes")
else:
  print("No")
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')
from sys import stdin, stdout
from collections import defaultdict
import math
from queue import Queue

n, m = map(int, stdin.readline().strip().split())
arr = list(map(int, stdin.readline().strip().split()))

threshold = 1 / (4 * m) * sum(arr)

arr = sorted(arr, reverse=True)

if arr[m - 1] >= threshold:
    stdout.writelines('Yes\n')
else:
    stdout.writelines('No\n')
def main():
  n,m=map(int,input().split())
  a=list(map(int,input().split()))
  total=sum(a)
  a.sort()
  if a[-m]<total/(4*m):
    print("No")
  else:print("Yes")

if __name__ == "__main__":
  main()
n, m = map(int, input().split())
a = [int(x) for x in input().split()]

ok = False
cnt = m
t = sum(a)
for i in range(n):
	if a[i] * 4 * m >= t:
		cnt -= 1
	if cnt == 0:
		ok = True
		break
		
if ok:
	print("Yes")
else:
	print("No")
# N = int(input())
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')
n, m = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)

count = 0
judge = lambda x: x >= total * (1 / (4 * m))
for vote in a:
  if judge(vote):
    count += 1
  if count >= m:
    print("Yes")
    exit()
print("No")
n, m = map(int, input().split())
num_list = sorted(list(map(int, input().split())), reverse=True)
flg = 0
for i in num_list[:m]:
    if i < sum(num_list) / (4 * m):
        flg = 1
        break
if flg == 0:
    print("Yes")
else:
    print("No")
n, m = map(int, input().split())
populars = list(map(int, input().split()))
populars.sort(reverse=True)

flag = "Yes"
for i, item in enumerate(populars):
    if item < sum(populars)*(1/(4*m)):
        flag = "No"
    if i >= m-1 : break
print(flag)
def solve(n, m, arr):
    arr.sort()
    for i in range(m):
        if arr[-1 - i] < sum(arr) * (1 / (4 * m)):
            return False
    return True

if __name__ == "__main__":
    n, m = map(int, input().split(' '))
    arr = [int(s) for s in list(input().split())]
    if solve(n, m, arr):
        print('Yes')
    else:
        print('No')
import sys

n,m = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse = True)
need = sum(A) / (4 * m)
for i in range(m):
    if A[i] < need:
        print("No")
        sys.exit()
print("Yes")
n,m=map(int,input().split())
A=list(map(int,input().split()))
ans=0
qq=sum(A)
for i in range(n):
  if A[i]>=qq/(4*m):
    ans+=1
    
print("Yes" if ans>=m else "No")
#B - Popular Vote
N,M= map(int, input().split())
A =list(map(int, input().split()))
tmp = 0
for i in range(N):
    if A[i] >= (sum(A)/(4*M)):
        tmp += 1
    else:
        pass

if tmp >= M:
    print("Yes")
else:
    print("No")
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")
import sys
I=input().split()
N=int(I[0])
M=int(I[1])
HYO=[0]*N

I=input().split()
SO=0
for _ in range(N):
    HYO[_]=int(I[_])
    SO+=int(I[_])

HYO.sort()
if (HYO[N-M]<SO/(4*M)):
    print("No")
else:
    print("Yes")
N,M = map(int, input().split())
A = list(map(int, input().split()))
A = sorted(A)[::-1]

if all(a>=(sum(A)/(4*M)) for a in A[0:M]):
    print("Yes")
else:
    print("No")
N, M = map(int, input().split())
A = list(map(int, input().split()))
vote_sum = sum(A)
cnt = 0
y = "Yes"
n = "No"

for i in range(N):
	if (A[i]*4*M) >= vote_sum:
		cnt += 1

if cnt >= M:
	print(y)
else:
	print(n)
n,m=map(int,input().split())
a=list(map(int,input().split()))
s=sum(a)
c=0
for i in range(len(a)):
  if a[i]<s/(4*m):
    c+=1
if n-c>=m:
  print('Yes')
else:
  print('No')
n,m = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse=True)
if l[m-1] >= sum(l)/(4*m):
  print("Yes")
else:
  print("No")
N, M = map(int, input().split())
A = list(map(int, input().split()))
b = sum(A)/(4*M)
c = len(list(filter(lambda x: x>=b, A)))
print("Yes" if c >= M else "No")
# Code for B - Popular Vote
# Use input() to fetch data from STDIN
[n, m] = map(int, input().split())
a = list(map(int, input().split()))

total = sum(a)

if len(list(filter(lambda x: x >= (total / (4 * m)), a))) >= m:
    print("Yes")
else:
    print("No")
N, M = map(int, input().split())
A = list(map(int, input().split()))

ans = 0
suma = sum(A)

for a in A:
    if a >= suma/(4*M):ans += 1
print('Yes' if ans>=M else 'No')
N,M= map(int,input().split())
A= list(map(int,input().split()))
summ=sum(A)
A.sort(reverse=True)

cnt=0
for num in A:
  if num >= summ/(4*M):
    cnt+=1
  else:
    break

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

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

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

k = sum(A) / (4*M)
print('Yes' if [a >= k for a in A].count(True) >= M else 'No')
n, m = input().split(" ")
n, m = int(n), int(m)
a = [int(i) for i in input().split(" ")]
vote = sum(a)
voted4 = vote / (4 * m)
a = sorted(a, reverse=True)
ans = 0
for i in a:
    if (i >= voted4):
        ans += 1
    else:
        break
if (ans >= m):
    print("Yes")
else:
    print("No")
import numpy as np
N,M=map(int,input().split())
A=np.array(list(map(int,input().split())))
print('Yes' if sum(A>=sum(A)/(4*M))>=M else 'No')
N,M=(int(x) for x in input().split())
As=[int(x) for x in input().split()]
p = sum(As)/(4*M)
ov = [1 if x>=p else 0 for x in As]
if sum(ov)>=M:
  print('Yes')
else:
  print('No')
import sys

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

total=sum(A)


sou=1/(M*4)
s=0
for a in A:
    tmp=a/total
    if(tmp >= sou):
        s+=1
        if(s == M):
            print("Yes")
            sys.exit()

print('No')
n , m = map(int,input().split())
a = list(map(int,input().split()))
A = sorted(a, reverse=True)

B = sum(a)

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

count = 0
_sum = sum(a)
for _a in a:
    if _a*4*m >= _sum:
        count += 1
print("Yes" if count >= m else "No")
N,M=map(int,input().split())
A = list(map(int,input().split()))
c=0
for i in range (N):
         if A[i]>= sum(A)/(4*M):
         	c +=1

if c>=M:
         print('Yes')
else:
         print('No')
N, M = map(int, input().split())
A = list(map(int, input().split()))

cnt = 0
for a in A:
    if a >= sum(A)/(4*M):
        cnt += 1
    
if cnt >= M:
    print('Yes')
else:
    print('No')
n,m=map(int,input().split())
A=list(map(int,input().split()))
a=0
s=sum(A)
for i in range(n):
  if 4*m*A[i]>=s:
    a=a+1
if a>=m:
  print("Yes")
else:
  print("No")
N, M = map(int, input().split())
List = list(map(int, input().split()))
List.sort(reverse=True)
AM = List[M-1]
if AM >= sum(List)/(4*M):
  print('Yes')
else:
  print('No')
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#l = list(map(int, input().split()))
n,m = map(int, input().split())
a = list(map(int, input().split()))

total = sum(a)
re = m
for i in range(n):
    if (4*m*a[i] >= total):
        re = re -1
        if (re == 0):
            print("Yes")
            exit()
print("No")
N,M=map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
  if  A[i]*M*4>=K:
    if i==N-1:
      breakflag=1
    continue
  else:
    answer=i
    break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
 
for i in a:
  if i >= sum(a)*(1/(4*m)):
    cnt += 1

if cnt >= m:
  print("Yes")
else:
  print("No")
n, m = [int(i) for i in input().split()]

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

th = sum(la) / (4*m)
num = sum([1 if i >= th else 0 for i in la])
if num >= m:
  print('Yes')
else:
  print('No')
a,b=map(int,input().split())
n=list(map(int,input().split()))
c=sum(n)/(4*b)
d=[i for i in n if i>=c]
if b>len(d):
    print('No')
else:
    print('Yes')
n, m = map(int, input().split())
list = list(map(int, input().split()))

list.sort(reverse=True)

if list[m-1] >= sum(list)/(4*m):
    print("Yes")
else:
    print("No")
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')
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")
N, M  = map(int, input().split())
A = [int(a) for a in input().split()]
thr = (sum(A) - 1) // (4 * M) + 1
cnt = 0
for a in A:
    if a >= thr:
        cnt += 1
if cnt >= M:
    print('Yes')
else:
    print('No')
# AtCoder Beginner Contest 161: B (2020/04/04)
N, M = map(int, input().split())
S = input().split()
A = [0 for i in range(N)]
for i in range(N):
    A[i] = int(S[i])
A.sort(reverse=True)
if A[M-1] < sum(A)/(4*M):
    print('No')
else:
    print('Yes')
n, m = map(int, input().split())
arr = list(map(int, input().split()))

cnt = 0
sm = sum(arr)
for a in arr:
    if a < sm / (4 * m):
        continue
    else:
        cnt += 1

if cnt >= m:
    print("Yes")
else:
    print("No")
N,M=map(int,input().split())
A=list(map(int,input().split()))
th=sum(A)/(4*M)
A.sort(reverse=True)

if A[M-1]>=th:
    print("Yes")
else:
    print("No")
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

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

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

a = sorted(a, reverse=True)

chflg = True

for i in range(m):
    if a[i] < cnt * 1 / (4 * m):
        chflg = False

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

A.sort(reverse=True)
B=A[0:M]
SUM=sum(A)

if any([ b<SUM/(4*M)  for b in B]):
  print("No")
else:
  print("Yes")
import math
n, m = map(int, input().split())
a = sorted(list(map(int,input().split())))
suma = sum(a)
a = [i for i in a if i * 4 * m >= suma]
ans = (len(a) >= m)
print("Yes" if ans else "No")
n, m = map(int, input().split())
a = list(map(int, input().split()))

a.sort(reverse=True)
for x in a[:m]:
    if x * 4 * m < sum(a):
        print('No')
        exit()
print('Yes')
import sys
import itertools
# import numpy as np
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

# map(int, input().split())
# list(map(int, input().split()))

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")
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
sum_a = sum(a)
if any([a[i] * 4 * m < sum_a for i in range(m)]):
  print('No')
else:
  print('Yes')
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse=True)
l = sum(A)/(4*m)
cnt = 0
for i in range(n):
    if A[i]>=l:
        cnt += 1
print('Yes'  if cnt>=m else 'No')
n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse = True)
#print(a)
status = True

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

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

if status:
    print("Yes")
else:
    print("No")
from math import ceil

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

s = ceil(sum(a)/(4*m))
a = sorted(a, reverse = 1)[:m]

for i in a:
    if i < s:
        print("No")
        break
else:
    print("Yes")
nm = [int(x) for x in input().split(' ')]
vote = [int(v) for v in input().split(' ')]

sum_vote = sum(vote)
thresh = sum_vote / (4 * nm[1])

vote_valid = [True if v >= thresh else False 
              for v in vote]

sum_vote_valid = sum(vote_valid)
if sum_vote_valid >= nm[1]:
  print('Yes')
else:
  print('No')
N, M = map(int, input().split())
A = list(map(int, input().split()))
if sorted(A)[-M] >= sum(A) / (4*M):
  print("Yes")
else:
  print("No")
n, m = map(int, input().split(' '))

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

a.reverse()

if a[m - 1] < sum(a) / (4 * m):
    print('No')
else:
    print('Yes')
N, M = map(int, input().split())
A = list(map(int, input().split()))
rank_A = sorted(A, reverse=True)
for i in range(M):
    if rank_A[i] < sum(A) / (4 * M):
        print("No")
        exit()
print("Yes")
n, m = map(int, input().split())
a_list = list(map(int, input().split()))
a_list.sort(reverse=True)
if a_list[m-1] < sum(a_list) / (4*m):
    print('No')
else:
    print('Yes')
N, M = map(int, input().split())
A = list(map(int, input().split()))
total_vote = sum(A)
selectable = total_vote / (4 * M)
A.sort(reverse = True)
count = 0

for i in range(N):
    if A[i] >= selectable :
        count += 1
        if count == M:
            print('Yes')
            break;

    else:
        print('No')
        break;
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')
n,m = map(int,input().split())
li = list(map(int,input().split()))
  
li.sort(reverse=True)
  
a=li[m-1]
b=sum(li)

if a>=b/4/m:
  print('Yes')
else:
  print('No')
def solve():
    N,M = [int(i) for i in input().split()]
    A = [int(i) for i in input().split()]
    total = sum(A)
    threshold = float(total) / (4*M)
    cnt = 0
    for num in A:
        if num >= threshold:
            cnt += 1
    if cnt >= M:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    solve()
import sys
input = lambda: sys.stdin.readline().rstrip()

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

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

limit = 1 / (4*M)

A.sort(reverse=True)
ans = 0
sum_A = sum(A)
for i in range(len(A)):
    if (A[i] / sum_A) >= limit:
        ans += 1
    if ans == M:
        print("Yes")
        exit()

print('No')
import sys
def main():
  n, m = map(int, input().split())
  l = list(map(int, input().split()))
  d = sum(l) / (4 * m)
  cnt = 0;
  for li in l:
    if li >= d:
      cnt = cnt + 1
  if cnt >= m :
    print ("Yes")
  else :
    print ("No")
  return

if __name__ == '__main__':
    main()
data = input().split()
n = int(data[0])
m = int(data[1])


a = input().split()
for i in range(n):
	a[i] = int(a[i])


sumvote = sum(a)

line = sumvote/(4*m)

c = 0

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



if c>=m:
	print("Yes")
else:
	print("No")
import numpy as np
 
[N, M] = list(map(int, input().split()))
A = list(map(int, input().split()))
threshold = np.sum(A) / (4 * M)
#print(threshold)
Th = [a for a in A if threshold <= a]
#print(Th)
if len(Th) < M:
  ans = 'No'
else:
  ans = 'Yes'
print(ans)
from math import ceil
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
val = sum(l)
f = 1
for i in range(m):
  if l[i] < ceil(val/(4*m)):
    f = 0
    break
if f:
  print("Yes")
else:
    print("No")
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
print('YNeos'[A[M-1]<sum(A)/4/M::2])
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
vote = []
all = 0
 
for j in range(N):
    all += A[j]
 
for i in range(N):
    if A[i] >= all / (4 * M):
        vote.append(A[i])
 
if len(vote) >= M:
    print("Yes")
 
else:
    print("No")
import sys
from pprint import pprint

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

v_sum = sum(A)
ans = 0
for a_i in A:
    if a_i >= (v_sum / (4 * M)):
        ans += 1

print("Yes" if ans >= M else "No")
N, M = map(lambda x: int(x), input().split(" "))
As = list(map(lambda x: int(x), input().split(" ")))

comp = sum(As)/(4*M)

result = 0
for a in As:
    if a >= comp:
        result += 1

if result >= M:
    print("Yes")
else:
    print("No")
n, m = map(int, input().split())
a = list(map(int, input().split()))

amax = max(a)
s = sum(a)

mm = s / (4 * m)
a.sort(reverse=True)

y = True
for i in range(m):
    if a[i] < mm:
        print('No')
        y = False
        break

if y:
    print('Yes')
n,m = map(int,input().split())
ai = list(map(int,input().split()))
s = sum(ai)
count = 0
for i in ai:
  if i >= s/(4*m):
    count += 1
if count >= m:
  print('Yes')
else:
  print('No')
N,M = map(int,input().split(" "))
MER = list(map(int,input().split(" ")))
mer_sum = sum(MER)

threshold = mer_sum / (4 * M)
mer_over = [1 if i >= threshold else 0 for i in MER]
mer_threshold = sum(mer_over)

if M <= mer_threshold:
  print("Yes")
else:
  print("No")
#!/usr/bin/env python3
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])
N, M = map(int, input().split())
A_list = list(map(int, input().split()))

A_list = sorted(A_list, reverse=True)

sum_A = sum(A_list)

if A_list[M-1] < (sum_A * (1 / (4 * M))):
    print('No')
else:
    print('Yes')
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum/(4*int(m)):
        yy+=1
if yy < int(m):
    print("No")
else:
    print("Yes")
N,M = map(int,input().split())
A = list(map(int,input().split()))
lim = sum(A)/(4*M)
ans = 0

for a in A:
  if a>=lim:
    ans+=1
    
if ans>=M:
  print("Yes")
else:
  print("No")
N,M = map(int,input().split())
A = list(map(int,input().split()))
cnt = 0
A.sort()
s = sum(A)
for i in range(N):
    if A[i] >= s*(1/(4*M)):
        cnt += 1
if cnt >= M:
    print("Yes")
else:
    print("No")
n,m = map(int,input().split())
a = sorted(list(map(int,input().split())))
b = sum(a)/(4*m)
print('Yes'if a[-m]>=b else'No')
a, b = map(int, input().split())
c=[0]*a
cnt=0
c=list(map(int, input().split()))
c.sort(reverse=True)
for i in range(a):
    if c[i]>=sum(c)/(b*4):
        cnt=cnt+1
if cnt>=b:
    print('Yes')
else:
    print('No')
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")
N,M = map(int,input().split())
A = [int(i) for i in input().split()]
A.sort(reverse=True)
B = sum(A)
if A[M-1] >= B/(4*M):
  print('Yes')
else:
  print('No')
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")
n,m = map(int,input().split())
a = list(map(int,input().split()))
sum = 0
cnt = 0
for i in a:
    sum += i
for i in a:
    if(sum <= 4*m*i):
        cnt += 1
if(cnt >= m):
    print("Yes")
else:
    print("No")
N,M=map(int,input().split())
A=list(map(int,input().split()))
L=sum(A)/(4*M)
j=0
A1=sorted(A,reverse=True)
for i in range(M):
    if A1[i]>=L:
        j+=0
    else:
        j+=1
if j==0:
    print("Yes")
else:
    print("No")
def can_vote(A, m):
    if m == 1:
        return True
    A.sort()
    total = sum(A)
    tt = total * (1/(4*m))
    
    counter = 0

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

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