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 = sorted(list(map(int, input().split())))[::-1]
s = sum(A)
for i in range(M):
    if A[i] < s/(4*M):
        print('No')
        break
else:
    print('Yes')

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

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

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

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

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

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

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

ans = 1 / (4 * M)
A = sorted(A, reverse=True)
ans1 = 0
for i in range(M):
    if A[i]/sum(A) >= ans:
        ans1 += 1
if ans1 == M:
    print('Yes')
else:
    print('No')

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

th = sum(Alist)/(4*M)
if len([a for a in Alist if a >= th]) >= M:
    print('Yes')
else:
    print('No')

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

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

for i in range(m):
    if a[i]<su*(1/(4*m)):
        print("No")
        exit(0)

print("Yes")

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] >= total / (4*m):
        
        cnt += 1

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

Solution (Python):
def get_ints():
    return map(int, input().split())

n, m = get_ints()
As = list(get_ints())

total = sum(As)

count = 0
for a in As:
    if a * 4 * m >= total:
        count += 1

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

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

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

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

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

list_2 = list(filter(lambda x: minValue <= x, A))

if M <= len(list_2):
  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 aa in a:
    if 4*aa*m>=s:
        c+=1
if c>=m:
    print('Yes')
else:
    print('No')

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

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

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

items = sorted(A)[::-1][:M]
border = sum(A) * (1 / (4 * M))
is_selectable = True
for item in items:
    if item < border:
        is_selectable = False
        break

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

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

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

ans = 'Yes'
sep = point / (4 * m)
a.sort()
a.reverse()
for i in range(m):
    if a[i] < sep:
        ans = 'No'

print(ans)

Solution (Python):
n, m = map(int, input().split())
A = list(map(int, input().split()))
total = sum(A)
limit = total / 4 / m

counter = 0
for a in A:
  if a >= limit:
    counter += 1
    
    
if counter >= m:
  print("Yes")
else:
  print("No")

Solution (Python):
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
s = sum(a)
c = 0
for i in a:
    if i >= s / (4 * m):
        c += 1
print("YNeos"[c < m::2])

Solution (Python):

"""
Created on Sat Apr  4 21:05:12 2020

@author: Kanaru Sato
"""

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

for i in range(len(a)):
    sum += a[i]
    
a.sort(reverse=True)

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

Solution (Python):



def solve(*args: str) -> str:
    n, m = map(int, args[0].split())
    A = list(map(int, args[1].split()))
    total = sum(A)
    ret = [a for a in A if total/(4*m) <= a]

    return 'Yes' if m <= len(ret) else 'No'


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

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

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

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

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

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

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

sAA = sorted(AA, reverse=True)
th = sum(AA) / (4*M)

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

Solution (Python):
N, M = map(int, input().split())
A = list(map(int, input().split()))
s = sum(A)
ans = 0
for i in A:
  if 4 * M * i >= s:
    ans += 1

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

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

a.sort()
a.reverse()

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

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


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

count=0

for i in a:
    if(i>=num):
        count+=1

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

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

sumu=0
for i in range(N):
    sumu+=As[i]

sles=sumu*0.25/M
count=0
flag="No"
for i in range(N):
    if As[i]>=sles:
        count+=1
    if count==M:
        flag="Yes"
        break



print(flag)

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

p=0

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

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

Solution (Python):
import sys
import numpy as np


n,m=map(int,sys.stdin.readline().split())
a=np.array(sys.stdin.readline().split(),dtype='int64')


a=np.sort(a)[::-1]
to=np.sum(a)

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

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


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


S = ceil(sum(A), 4 * M)
print('Yes' if sum(1 if a >= S else 0 for a in A) >= M else 'No')

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

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

lis = sorted(vote, reverse=True)

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

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

total = sum(A)
cnt = 0

for a in A:
    if a >= total/(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()))
import numpy as np
asun = np.array(a)
suma = asun.sum()
a.sort(reverse=True)
cnt = 0
ans = 'Yes'
for aa in a:
  cnt += 1
  if aa < suma/(4*m):
    ans = 'No'
    break
  if cnt == m:
    break
print(ans)

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

average = sum(A) / M

count = 0
for a in A:
    if a >= (average / 4):
        count += 1

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

Solution (Python):
n, m = map(int, input().split())
p = [int(_) for _ in input().split()]
sum_p = sum(p)
count = 0

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

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

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

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

ans = 0

s = 0

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

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

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

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

import sys

limit=sum(A)/(4*M)
A.sort()
A=A[::-1]
for i in range(M):
    if A[i] < limit:
        print('No')
        sys.exit()
else:
    print('Yes')

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

ans = 0
for num in A:
  if (amount / (4 * M)) <= num:
    ans += 1
if(ans >= M):
  print("Yes")
else:
  print("No")

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

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

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

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

thresh = sum(a) / (4 * m)
selected = list(filter(lambda x: x >= thresh, a))

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

Solution (Python):


N, M = map(int, input().split(' '))
A = list(map(int, input().split(' ')))
threshold = sum(A) / (4 * M)
A.sort(reverse=True)

for i in range(M):
    if A[i] < threshold:
        print('No')
        exit(0)
print('Yes')

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

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

for i in range(N):
    if A[i]>=J:
        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)
su = sum(A)
flag = True
for i in range(M):
  if A[i] < su/(4*M):
    flag = False
if flag == False:
  print("No")
else:
  print("Yes")

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


def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    total = sum(a)

    min = total / (4*m)

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


main()

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

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

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

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
r = sum(A)/(4*M)
tmp = N
ans = 'Yes'
for a in A:
    if a < r: tmp -= 1
    if tmp < M:
        ans ='No'
        break
print(ans)

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

A = [x for x in A if x >= (sum(A)/4/M)]
if len(A) >= M:
    print('Yes')
else:
    print('No')

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


if __name__ == '__main__':
    main()

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

A.sort()
s = sum(A)

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

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

Solution (Python):
N, M = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
t = sum(l) / 4 / M
num = 0
ans = 0
for i in range(len(l)):
  if l[i] >= t:
    num += 1
  if num >= M:
    ans += 1
    break
if ans == 1:
  print('Yes')
else:
  print('No')

Solution (Python):
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True 
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n,m = inm()
a = inl()
t = sum(a)
a.sort(reverse=True)
cnd = (a[m-1]*4*m >= t)
print('Yes' if cnd else 'No')

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

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 LLI(rows_number): return [LI() for _ in range(rows_number)]

n,m = MI()
a = sorted(LI())[::-1]
asum = sum(a)
if a[:m][-1]>=asum*(1/(4*m)):
    print('Yes')
else:
    print('No')

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

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

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

A = sorted(A, reverse=True)

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

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

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

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

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

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

Solution (Python):
import sys


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

border = sum(As)*1/(4*M)
As_best = sorted(As, reverse=True)[:M]

for A in As_best:
    if A < border:
        print('No')
        sys.exit()
print('Yes')

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

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

Solution (Python):


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

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

votes = sum(arr)

c = n

for i in arr:
    if i < votes / (4 * m):
        c -= 1

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

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

crit = 1/4/m * sum(alist)

count = 0

for a in alist:
    if a >= crit:
        count += 1



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

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

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

lists.sort(reverse=True)
S = sum(lists)

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

Solution (Python):
import string
def num():
    return int(input())
def nums():
    return list(map(int,input().split()))

N,M = nums()
A = nums()
sum_v = sum(A)
ans = 0
for i in A:
    if i >= sum_v / (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()))

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

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

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

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

su_li = sum(lis)
line = su_li / 4 / m
for item in lis:
  if item >= line:
    count += 1
if count >= m:
  print('Yes')
else:
  print('No')

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

cnt = 0

for x in range(0,N):
  if lst[x] >= sum(lst)/(4*M):
    cnt +=1

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

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

criteria = sum(A) / m * 0.25
if A[-m] >= criteria:
    print('Yes')
else:
    print('No')

Solution (Python):
n,m = map(int, input().split())
a = list(map(int, input().split()))
count = 0
lim = sum(a)/(4*m)
for num in a:
    if num >= lim:
        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)
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()))




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

A.sort(reverse=True)

count = 0
for i in range(M):
    
    if A[i] / sum_vote >= th:
        count += 1
    else:
        break

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

Solution (Python):
import sys

def main():
    N, M = map(int, input().split())
    As = list(map(int, input().split()))
    sys.stderr.write(str(As))
    sys.stderr.write('\n')


    s = sum(As)
    cnt = len([a for a in As if a >= 1.0 * s / (4*M)])
    sys.stderr.write(str(s))
    sys.stderr.write('\n')
    sys.stderr.write(str(cnt))
    sys.stderr.write('\n')


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

    return 0

if __name__ == '__main__':
    sys.exit(main())

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 4*M*a[i] >= 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()))
ax = sorted(a,reverse=True)[:m]


sa = sum(a)

if (ax[-1] < sa / (4 * m)):
    print("No")
else:
    print("Yes")

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

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

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

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

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

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

a_sum = sum(a_list)
a_sorted = sorted(a_list)[::-1]

if a_sorted[m-1] >= a_sum/m/4:
    print('Yes')
else:
    print('No')

Solution (Python):
n,m=map(int,input().split())
alist=list(map(int,input().split()))
soutokuhyou = sum(alist) / (4*m)
count = 0

for i in alist:
    if i >= soutokuhyou:
        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 = [x for x in A if x >= sum(A)/(4*M)]
print("Yes" if len(B) >= M else "No")

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

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

if A[M-1]*4*M<total:
    print("No")
else:
    print("Yes")

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

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

Solution (Python):
n,m = map(int,input().strip().split())
ls = list(map(int,input().strip().split()))
mini = sum(ls)/(4*m)
i = 0
while i<n and m>0:
    if ls[i]>=mini:
        m -= 1
    i += 1
if m<=0:
    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]*4*m < sum(a):
    print("No")
else:
    print("Yes")

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
vote = sum(A)
count = 0
for i in A:
    if i >= vote/(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()))
result = 0
s = sum(A)
for i in A:
    if i >= (1/(4*M))*s:
        result += 1
if result >= M:
    print("Yes")
else:
    print("No")

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

ans = [a_i for a_i in A if a_i>=A_sum/(4*m)]

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

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

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

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

b = sum(a)/(4.0*m)
c = 0
for i in range(n) :
    if a[i]>=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()))
cnt=0
s=sum(a)/(4*m)
for i in range(n):
    if a[i]>=s:
        cnt+=1
if cnt>=m:
    print('Yes')
else:
    print('No')

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

Solution (Python):
N,M = list(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')

Solution (Python):
from math import ceil


n, m = map(int, input().split())
a = list(map(int, input().split()))
a_sum = sum(a)
a.sort(reverse=True)
a_limit = ceil(a_sum / (4 * m))
if a[m-1] < a_limit:
    print('No')
else:
    print('Yes')

Solution (Python):
n, m = [int(x) for x in input().split()]
a = [-int(x) for x in input().split()]
a.sort()
if -a[m - 1] * 4 * m < -sum(a):
    print('No')
else:
    print('Yes')

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

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

A.sort(reverse=True)
ans="Yes"
for i in range(m):
    if A[i]<sum(A)/4/m:
        ans="No"
        break
print(ans)

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

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

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

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

Solution (Python):
n,m=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a)[::-1]
sum_a=sum(a)
flag=True
for i in range(m):
    if a[i] <sum_a/(4*m):
        flag=False
        break
if flag==True:
    print("Yes")
else:
    print("No")

Solution (Python):
N, M = map(int, input().split())
A = sorted([int(a) for a in input().split()], reverse=True)

joken = sum(A)/(4*M)
can_choose = True
for i in range(M):
    if A[i] < joken:
        can_choose = False
        break

if can_choose:
    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())
L=list(map(int,input().split()))
S=sum(L)
count=0
for i in range(N):
	if L[i]>=S/(4*M):
		count+=1
if count>=M:
	print("Yes")
else:
	print("No")

Solution (Python):
N,M = map(int,input().split())
L = [i for i in map(int,input().split())]
Vote = sum(L)
Res = [i for i in L if i >= (Vote/(4*M))]
if len(Res) >= M:
  print('Yes')
else:
  print('No')

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

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

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

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

lst.sort(reverse=True)
S = sum(lst)

if lst[m-1]<S/(4*m):
    print("No")
else:
    print("Yes")

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

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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: int, M: int, A: "List[int]"):
    s = sum(A)
    cnt = 0
    for i in range(N):
        if A[i] >= s / (4 * M):
            cnt += 1
    print(YES if cnt >= M else 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 = list(map(int, input().split()))
sum_a = sum(a_list)
count = 0

for a in a_list:
    if a < sum_a / (4 * m):
        continue
    else:
        count += 1

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

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

    
if __name__ == "__main__":
    resolve()

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

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

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

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

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

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

total = sum(A)

bdr = total /(4*M)

A.sort(reverse=True)

C = 1

if A[M-1] < bdr:
  C = 0
  
if C == 1:
  print("Yes")
else:
  print("No")

Solution (Python):
import math

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

tot = sum(A)

a = 0
for i in range(N):
    if A[i] >= math.ceil(tot / (4 * M)):
        a += 1

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

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

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

Solution (Python):
def main():
    n,m = tuple([int(t)for t in input().split()])

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

    votesum = sum(a)

    ans = 0
    for a_i in a:
        if a_i < votesum/4/m:
            pass
        else:
            ans+=1
    if ans>=m:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

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

Solution (Python):
N, M = map(int, input().split())
lst = list(map(int, input().split()))
low = sorted(lst, reverse=True)[M-1]
limit = sum(lst)/(4*M)

if low < limit:
    print('No')
else:
    print('Yes')