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):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: int, M: int, A: "List[int]"):

    sumA = sum(A)
    sortA = sorted(A, reverse=True)

    thresh = sumA / (4*M)

    for a in range(M):

        if sortA[a] < thresh:
            print(NO)
            return
    print(YES)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    M = int(next(tokens))  
    A = [int(next(tokens)) for _ in range(N)]  
    solve(N, M, A)

if __name__ == '__main__':
    main()

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

s = sum(l)
    


l = sorted(l,reverse=True)



x = (1 / (4*m)) * s
ans = 0




for i in range(m):
    if(l[i] >= x):
        ans = ans + 1
    

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

Solution (Python):

import sys
import numpy as np
 
YES = "Yes"  
NO = "No"  
 
 
def solve(N: int, M: int, A: "List[int]"):
    A = np.array(A)
    n_sum = np.sum(A)/4/M
    if len(set(A)) != N:
        print("??")
    if (A >= n_sum).sum() >= M:
        print(YES)
    else:
        print(NO)
 
    return
 
 

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    M = int(next(tokens))  
    A = [int(next(tokens)) for _ in range(N)]  
    solve(N, M, A)
 
if __name__ == '__main__':
    main()

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

dsrxq=0
for i in range(n):
  if a[i]*4*m>=unta:
    dsrxq+=1
if dsrxq>=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(M):
  if A[i] < sum(A) / (4*M):
    print('No')
    exit()

print('Yes')

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

Solution (Python):
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

n, m = na()
a = na()

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

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

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

vote = 0


for v in list :
    vote = vote + v

judge = vote / (4 * M)

pop = 0
for x in range(0, N) :
    if list[x] >= judge :
        pop = pop + 1

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

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

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

Solution (Python):

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

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

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

Solution (Python):
def calc():
    summ  = sum(A)
    low = summ / (4*M)
    newlist = [i for i in A if i >= low]
    num = len(newlist)
    
    if M <= num:
        print ("Yes")
    else:
        print ("No")

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



calc()

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
t=sum(a)
a=list(filter(lambda x: t/(4*m) <= x, a))
print('Yes' if m <= len(a) else 'No')

Solution (Python):

    
    
    
    
    

    
    

    
    

    
        
    
        

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





S = sum(A)
cnt = 0

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

Solution (Python):
import sys

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

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

new_a=sorted(a,reverse=True)
sums=sum(a)

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

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

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

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

Solution (Python):
import math
num, m = map(int,input().split())
list = [int(x) for x in input().split()]


count = 0

for i in range(num):
    if list[i] < sum(list)/(4*m):
        None
    else:
        count += 1

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

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

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

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



def check(A,M):
    flag = 0
    condition = sum(A)/(4*M)
    if(M==1 and max(A)>condition):
        return "Yes"
    for i in A:
        if(i < condition):
            continue
        elif(i >= condition):
            flag+=1
            if(flag==M):
                return "Yes"
    return "No"

print(check(A,M))

Solution (Python):
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N, M = MI()
A = LMI()

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

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

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

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

num = sum(A)/4/M
cur = 0
for a in A:
    if a >= num:
        cur += 1
        if cur == M:
            print('Yes')
            sys.exit()
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()))
s=sum(a)
k=0
for x in a:
    if x>=s/(M*4):k+=1
if k>=M:
    print("Yes")
else:
    print("No")

Solution (Python):


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

lmt = sum(P) / (4*m)

if lmt <= P[-1*m]:
    print('Yes')
else:
    print('No')

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

sum = sum(A) / (4 * M)
ans = 0
for i in A:
    if i >= sum:
        ans += 1
if ans >= 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()]
total = sum(A)
print('Yes' if len([1 for a in A if a * 4 * M >= total]) >= M else 'No')

Solution (Python):

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


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


total = sum(A)


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

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

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

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

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

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

Solution (Python):
def main(n: int, m: int, a: list):
    ans = 0
    base = sum(a) / (4 * m)

    for i in a:
        if i >= base:
            ans += 1

        if ans >= m:
            print("Yes")
            return

    print("No")


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

    main(n, m, a)

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

A_sum =sum(A)

ans = 0
for i in range(N):
    if A[i] >= A_sum/(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.sort(reverse=True)

vote = sum(a)

if a[m-1] >= vote*1/(4*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()]

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

count = 0
for a in A:
    if a >= point:
        count += 1

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

Solution (Python):
n,b= map(int, input().split())
 
a= list(map(int, input().split()))
 
new_list = sorted(a, reverse=True)
sums = sum(a)

if new_list[b-1] >= sums/(b*4):
    	print("Yes")
else:
    	print("No")

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

Solution (Python):
NM = [int(_) for _ in input().split()]
N = NM[0]
M = NM[1]

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

def solve(N, M, A):
    
    d = sum(A) / (4 * M)
    
    a = [i for i in A if i>=d ]
    
    if  len(a) >= M:
        return "Yes"
    else:
        return "No"

print(solve(N, M, A))

Solution (Python):
nmlist = list(map(int, input().split()))
svote = list(map(int, input().split()))
allvote = sum(svote)
maxvote = max(svote)
svote.sort(reverse=True)
n0 = nmlist[1] - 1
n1 =  svote[n0] / allvote
n2 = 1 / (4 * nmlist[1])
if n1 >= n2:
    print("Yes")
else:
    print("No")

Solution (Python):
N, M = map(int, input().split())
votes = list(map(int, input().split()))
min_votes = sum(votes) * 1.0 / (4*M)
votes_greater_than_min = list(filter(lambda x: x >= min_votes, votes))
if len(votes_greater_than_min) >= M:
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
import math
N,M = (int(y) for y in input().split())
A = list(map(int, input().split()))
X = math.ceil(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())

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

L = len(S)
SUM = sum(S)



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

Solution (Python):
i1 = input()
i1 = i1.split()
types = int(i1[0])
select = int(i1[1])

i2 = input()
i2 = [int(n) for n in i2.split()]
i2.sort(reverse=True)

summary = sum(i2)
threshold = summary / (select * 4)




if i2[select-1] < threshold :
    print("No")
else:
    print("Yes")

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

Solution (Python):

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

C = map(int, input().split())

A = list(C)






B = []
for i in range(len(A)):
    if A[i] >= sum(A)/4/M:
        B.append(1)
    else:
        B.append(0)

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

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()
yes = lambda boolean: print('Yes') if boolean else print('No')
input_ints = lambda: list(map(int, input().split()))
 
N, M = input_ints()
A = input_ints()
A.sort(reverse=1)
yes(A[M-1]*4*M>=sum(A))

Solution (Python):



'''

'''

import numpy as np

N, M = map(int, input().split())
a = list(map(int, input().split()))
a = np.array(a)
s = int(a.sum())
level = 1 / (4 * M)



cnt = (a >= level * s).sum()

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

Solution (Python):
num, choice = map(int, input().split())
tmp = input().split()
product_list = [int(s) for s in tmp]
product_list.sort(reverse=True)
sum = 0
for i in range(num):
    sum += product_list[i]
if product_list[choice-1] >= sum/(choice*4):
    print("Yes")
else:
    print("No")

Solution (Python):
def has_duplicates2(seq):
    seen = []
    unique_list = [x for x in seq if x not in seen and not seen.append(x)]
    return len(seq) != len(unique_list)

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

NGcount = 0
sumA = sum(A)
Z = -(-sumA // (4 * M))

for x in range(M):
    if A[x] < Z:
        NGcount = NGcount + 1

if M > N:
    print('No')
elif has_duplicates2(A):
    print('No')
elif min(A) == 0:
    print('No')
else:
    if NGcount == 0:
        print('Yes')
    else:
        print('No')

Solution (Python):
import math
def RA():
    l = input().split()
    return [int(i) for i in l]
 
[n, m] = RA()
votes = RA()
 
s = [0] * 1001
for v in votes:
  s[v] = 1
 
start = math.ceil(sum(votes)/(4 * m))
count = 0
for i in range(start, 1001):
  if s[i] == 1:
    count += 1
    if count == m:
      print("Yes")
      break
if count < m:
  print("No")

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

check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1

ans = N - x

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

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

A.sort(reverse = True)
if M > 1:
    for i in range(M):
        if A[i] >= sum(A)*(1/(4*M)):
            del[i]
        else:
            print('No')
            exit()
    print('Yes')
elif M == 1:
    if A[1] >= sum(A)*(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(" ")]

cnt = 0
sum1 = sum(A)
p = 1/(4*M)

for i in range(len(A)):
    A[i] = A[i]/sum1

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


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

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

print("Yes" if popular >= m else 'No')

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

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

check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1

ans = N - x

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

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)
div = 4 * m
limit = total / div
a.sort()
a.reverse()
ans = True
for i in range(m):
    if a[i] < limit:
        ans = False
        break

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

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

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

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

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

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


t = 0
check=False
for x in range(len(a)):
  t += a[x]

for i in reversed(range(len(a))):
  for j in range(i):
    if(a[j] < a[j+1]):
      a[j], a[j+1] = a[j+1],a[j]

for y in range(m):
  if(a[y] >= t/(4*m)):
    check = True
  else:
    check=False
    break

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

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

Solution (Python):
def swap(a,b):
  return b,a
n,m = map(int,input().split())
arr = list(map(int,input().split()))
sum = 0
for i in arr:
  sum += i
sum = sum/(4*m)
count=0
for i in arr:
  if (i>=sum):
    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()))
m = 0
s = sum(A)
for i in range(N):
  if A[i] < math.ceil(s/(4*M)):
    pass
  else:
    m += 1

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

Solution (Python):
_, M = map(int,input().split())
A = list(map(int,input().split()))
sum_A = sum(A)
count = 0
result = "No"
for i in A:
    if i >= sum_A * 1/(4*M):
        count += 1
    if count == M:
        result = "Yes"
        break
print(result)

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

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

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

Solution (Python):
n,m=map(int,input().split())
List=[int(i) for i in input().split()]
s=sum(List)
for i in range(m):
    a=max(List)    
    if a>=s*(1/(4*m)):
        del List[List.index(a)]
        a=1
       
    else:
        
        a=0

print('Yes' if a==1 else 'No')

Solution (Python):
n, m=tuple(map(int , input().split()))
vo=list(map(int, input().split()))
c=0
su=sum(vo)
k=su/(4*m)
for i in range(n):
    if(vo[i]>=k):
        c+=1
    else:
        continue
if(c>=m):
    print("Yes")
elif(c<m):
    print("No")

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

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

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

Solution (Python):
li = list(map(int,input().split()))
la = list(map(int,input().split()))

b = 0

for num in range(0,li[0]):
    b += la[num]

c = b/4/li[1]

d = 0

for i in range(0,li[0]):
    if la[i] >= c:
        d += 1

if d >= li[1]:
    print("Yes")
else:
    print("No")

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= 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):
n,m = map(int, input().split());
l = list(map(int, input().split()))

num = 0;
th = sum(l)/(4*m);
for i in range(len(l)):
    if l[i] >= th:
        num += 1;
if num >= m:
    print('Yes');
else:
    print('No');

Solution (Python):
f=lambda:map(int,input().split());_,m=f();l=sorted(f());print('YNeos'[l[-m]*4*m<sum(l)::2])

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

a = len(m)
sum = 0
for i in range(a):
  sum += int(m[i])

item2 = []
for i in range(a):
  item2.append(int(m[i]) / sum)

ans = 1 / (4 * int(n[1]))

item3 = []
for i in range(a):
  if item2[i] >= ans:
    item3.append(item2[i])

if int(n[1]) <= int(len(item3)):
  print('Yes')
else:
  print('No')

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

Solution (Python):

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

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




count = 0

for i in range(len(a_list)):

    
    

    if border <= a_list[i] :
        
        count = count + 1

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

Solution (Python):
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = [i for i in b if sum(b)/(4*a[1]) <= i ]
if len(c) >= a[1]:
  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)
a_total = sum(a_list)
count = 0
for voted in a_list[:M]:
  if voted < (1/(4*M))*a_total:
    print("No")
    break
else:
  print("Yes")

Solution (Python):
n, m = map(int, input().split())
a_list = input().split()
a_sum = 0
for i in range(len(a_list)):
    a_list[i] = int(a_list[i])
    a_sum += a_list[i]
a_list.reverse()
 
ok_num = 0
kijyun = int(a_sum/(4*m))
if a_sum % (4*m) == 0:
    kijyun -= 1
for i in a_list:
    if i > kijyun:
        ok_num += 1
    if ok_num == m:
        print('Yes')
        quit()
print('No')

Solution (Python):
n,m = (int(x) for x in input().split())
list = (input().split())
for i in range(len(list)):
  list[i] = int(list[i])
la = sorted(list, reverse=True)
sum = 0
for i in range(len(list)):
  sum += list[i]
if la[m-1]<sum/(4*m):
  print('No')
else:
  print('Yes')

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

v = sum(A) / 4.0 / M

c = 0
for i in range(N):
    if A[i] >= v:
        c += 1

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

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
c = sum(a)/(4*m)
ans = sorted(a, reverse=True)
ans_0 = ans[:m]
if min(ans_0) < c:print('No')
else:print('Yes')

Solution (Python):
from sys import stdin
N,M = map(int,input().split())
A=  [int(x) for x in stdin.readline().rstrip().split()]
A.sort()
s = sum(A)
if ( s / (4 * M) > A[-M]) :
  print("No")
else:
  print("Yes")

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

arr.sort()
arr.reverse()

ans=0
total=sum(arr)

for i in range(m):
    if(arr[i]>=(total/(4*m))):
        ans+=1


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

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

for i in A:
    if (1/(M*4)) <= (i/S):
        c+=1
print("Yes" if M<=c else "No")

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

Solution (Python):
import itertools
N,M=map(int,input().split())
A=list(map(int,input().split()))
sum=sum(A)
A=sorted(A)
cnt=0
for i in A:
  if i>=sum/(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()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

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

Solution (Python):
def inputs(): return [int(x) for x in input().split()]
n,m = inputs()
A = inputs()
A = sorted(A,reverse=True)
cnt = 0
a = sum(A)
for i in A:
    if a<=i*4*m:
        cnt+=1
if m<=cnt:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys

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

total_votes = sum(A)
threshold = total_votes * (1 / (4 * M))

chooseable = 0

for a in A:
  if a >= threshold:
    chooseable += 1
    if chooseable >= M:
      print("Yes")
      sys.exit(0)

print("No")

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

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

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

n = M - 1
K = sum(A)

if A[n] < K / (4 *M):
  print('No')
else:
  print('Yes')

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


sums = sum(lists)/4/m

lens = len(lists)
state = 0
for i in range(m):
    if lists[lens-1-i] < sums:
        state = 1        
        break
if state ==1:
  	print("No")
else:
  	print("Yes")

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

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

c = 0
m = sum(A)/(4.0*M)
for a in A:
    if a >= 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()

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")

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

zenbu = sum(A)
waruno = 4 * M
joken = zenbu / waruno

ninki = sum( i >= joken for i in A)

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

Solution (Python):
import numpy as np
n, m = list(map(int,(input().split())))
a = np.array(list(map(int,(input().split()))))

all_b = sum(a)
t = 1/(4*m)*all_b


ans = np.where(a>=t)




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

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

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

if A[nm[1]-1] >= s/4/nm[1]:
    print("Yes ")
else:
    print("No ")

Solution (Python):

A = list(map(int, input().split()))
B =	list(map(int, input().split()))
num = A[0]
jud = A[1]
all = sum(B)
n = 0
C = 0
AN = 0

while n < num :
	AN = B[n]
	n += 1
    
	if AN < all / (jud*4):
		continue
	
	else:
		C += 1
    
if C >= jud:
	print("Yes")
else:
	print("No")

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

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

cnt = 0
for item in A:
    if item >= v_min:
        cnt += 1
    else:
        break
if cnt >= M:
    print('Yes')
else:
    print('No')

Solution (Python):
import numpy as np
l_input = [int(e) for e in input().split()]
A = [int(e) for e in input().split()]
A = np.array(A)
N = l_input[0]
M = l_input[1]
A_dash = A-1/(4*M)*sum(A)
cnt = 0
for i in A_dash:
    if i >=0:
        cnt += 1
if cnt >= M:
    print('Yes')
else:
    print('No')

Solution (Python):
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')

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

check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1

ans = N - x

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

Solution (Python):
NM = input().split()
N = int(NM[0])
M = int(NM[1])

A = []
kosuu = 0

tmp = input().split()
for i in range(N):
  A.append(int(tmp[i]))

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

for i in A:
  if i >= tmp:
    kosuu += 1

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

Solution (Python):
N, M = map(int, input().split())
l = list(map(int, input().split()))  
 
S = sum(l)
X = 4*M
 
lr = [i for i in l if i >= S/X]
 
if len(lr) >= M:
  	print("Yes")
else:
  	print("No")

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

aaa.sort(reverse=True)
result = [0]*b
for i in range(b):
    h = aaa[i]
    j = sum(aaa) / (4*b)

    if h >= j:
        result[i] = 1
    else:
        result[i] = 0

if result.count(1) >= b:
    ans = "Yes"
else:
    ans = "No"

print(ans)

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

def unko(A,M):
    for i in range(M):
        if A[i]< sum(A)/(4*M):
            return print("No")
    print("Yes")
unko(A,M)

Solution (Python):
N, M=input().split()
A=list(map(int,input().strip().split()))
ls=[]
for Ai in A:
    if int(Ai)>=(1/(4*int(M)))*sum(A):
        ls.append(Ai)
if len(ls)>=int(M):
    print('Yes')
else:
    print('No')

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

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

if a[-m] >= hikaku:
  print('Yes')
else:
  print('No')

Solution (Python):
n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

Solution (Python):
n=input().split()
N=int(n[0])
M=int(n[1])
a=input().split()

a = [int(i) for i in a] 
b=sum(a)/(4*M)
c=sorted(a)[Ｍ*-1]
if  b <= c :
     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(0, N):
    if A[i] < (total/(4*M)):
        continue
    cnt += 1
if cnt >= M:
    print('Yes')
else:
    print('No')