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 bisect,sys
import math
from collections import deque

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))

INF = 1 << 29

DIV = (10**9) + 7

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max, mod=DIV):
    fac, finv, inv = [0]*max, [0]*max, [0]*max
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        finv[i] = finv[i-1]*inv[i] % mod

    class CONV:
        def __init__(self):
            self.fac =fac
            self.finv = finv
            pass

        def ncr(self, n, k):
            if(n < k):
                return 0
            if(n < 0 or k < 0):
                return 0
            return fac[n]*(finv[k]*finv[n-k] % mod) % mod
        
    return CONV()



sys.setrecursionlimit(200005)

def main():
    N,M = isRaw()
    As = isRaw()
    As.sort(reverse=True)
    sumA = sum(As)
    ans = "Yes" if As[M-1] >= sumA/(4*M) else "No"
    return ans

if __name__ == "__main__":
    print(main())

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

Solution (Python):



import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read


n,m,*a = [int(i) for i in read().split()]

s = sum(a)
good = [1 for i in a if s <= 4*i*m]
if len(good) >= m:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
import sys
import math
import collections
from collections import deque
import heapq

n, m = map(int, sys.stdin.readline().split())

a = list(map(int, sys.stdin.readline().split()))

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

a.sort(reverse = True)

for i in range(m):
    if a[i] < y:
        print("No")
        sys.exit()

print("Yes")

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

X = len([a for a in A if (a / S >= 1 / (4 * M))])
if X >= 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 range(n):
    if a[i] >= sum(a) / (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()))
S = sum(A)
t = 0
for e in A:
    if e >= S/(4*M):
        t += 1

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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

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

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


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    n, m = map(int, input().split())
    *a, = map(int, input().split())

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

    cnt = 0
    for x in a:
        if x >= LIM:
            cnt += 1

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

n,m = nm()
a = nl()
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.sort(reverse=True)

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

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

if __name__ == '__main__':
    main()

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

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

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict
from itertools import combinations, permutations
from itertools import accumulate
from math import ceil, sqrt, pi

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

S = sum(A)
cnt = 0

for a in A:
    if a / S >= 1 / 4 / M:
        cnt += 1

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

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

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

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

Solution (Python):

import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def isOK(A):
    A.sort()
    for i in range(len(A) - 1):
        if A[i] + 1 != A[i + 1]:
            return False
    return True


def solve():
    N, M = Scanner.map_int()
    A = Scanner.map_int()
    S = sum(A)
    r = 1 / (4 * M) * S
    cnt = 0
    for a in A:
        if a >= r:
            cnt += 1
    print('YNeos'[not cnt >= M::2])


def main():
    
    solve()


if __name__ == "__main__":
    main()

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

S = sum(A)
line = -(-S/(4*M))

A.sort()
A = A[::-1]
flag = 1
for i in range(M):
    if A[i] < line:
        flag = 0
        break
if flag == 1:
    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 = (int(num) for num in input().split())
a = [int(num) for num in input().split()]
a.sort(reverse = True)
if a[m-1] < sum(a) / (4 * m):
    print("No")
else:
    print("Yes")

Solution (Python):
N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
total = sum(A)
cnt = 0
for ai in A:
    if total/(4*M) <= ai:
        cnt += 1
if M <= cnt:
    print("Yes")
else:
    print("No")

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n, m = na()
a = na()
a.sort()
if a[-m] >= sum(a) * 1/(4*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)

for i in range(n):
    if A[i]>=s/(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)
    A = sorted(A, reverse=True)
    if A[M-1] < S / (4 * M):
        print(NO)
    else:
        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):
from sys import stdin,setrecursionlimit
n,m = map(int,stdin.readline().rstrip().split())
li = list(map(int,stdin.readline().rstrip().split()))
li.sort(reverse=True)
if li[m-1] < sum(li)/(4*m):
    print("No")
else:
    print("Yes")

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby
    
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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


if __name__ == '__main__':
    main()

Solution (Python):
import math
def rMap():
	return map(int,input().split())
def rList():
	return list(map(int,input().split()))
n,m = rMap()
a = sorted(rList())
if a[-m]>=sum(a)/(4*m):
	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] / total >= 1 / (4 * M):
        cnt += 1
print("Yes" if cnt >= M else "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()))
tot = sum(a)
sol = 0
for i in a:
    if (i >= (1 / (4 * m)) * tot): sol += 1
print("Yes" if sol >= m else "No")

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

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

print("Yes" if a[-m]>=thread else "No")

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

Solution (Python):
n, m = map(int, input().split())
a = list(map(int, input().split()))
sum = sum(a)
cnt = 0
for x in a:
    if x * 4*m >= sum:
        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(reverse=True)

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

if (a[m - 1] < t):
    print("No")
else:
    print("Yes")

Solution (Python):
import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)


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

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

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

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

Solution (Python):

N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse=True)
S = sum(A)

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

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

Solution (Python):

def resolve():

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

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

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




resolve()

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

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

S=0
SUM=sum(A)
for a in A:
    if a*4*M>=SUM:
        S+=1

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

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

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]*4*M >= s:
    print('Yes')
else:
    print('No')

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
cnt = 0
all = sum(A)
for i in range(N):
    if A[i] >= all/(4.0*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()))

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

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

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

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

Solution (Python):
n, m = map(int, input().split())
A = list(map(int, input().split()))
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')

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

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

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline

N, M, *A = map(int, read().split())
s = sum(A) / (4 * M)
a = [i for i in A if i >= s]
if len(a) >= 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)

cnt = 0
for i in range(N) :
  if A[i] * 4 * M >= s :
    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())))[::-1]
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)
base = sum(A)/(4*M)
if A[M-1] >= base:
    print("Yes")
else:
    print("No")

Solution (Python):
n,m,*a=map(int,open(0).read().split())
s=sum(a)
f=sum(x*4*m>=s for x in a)
if f>=m:
  print("Yes")
else:
  print("No")

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

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

if __name__ == "__main__":
    main()

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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from bisect import bisect_right, bisect_left
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, gamma, log
from operator import mul
from functools import reduce
from copy import deepcopy

sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7



n, m = LI()
ret = 0
A = LI()
for a in A:
    if a >= sum(A) / (4 * m):
        ret += 1


if ret >= 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 a in A:
    if a*4*M < s: continue
    k += 1
print('Yes' if k>=M else 'No')

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

Solution (Python):
n,m=list(map(int, input().split()))
l=list(map(int, input().split()))
l.sort(reverse=True)
x=sum(l)/(4*m)
for i in range(m):
  if l[i]<x:
    print("No")
    break
else:
  print("Yes")

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,M=MI()
    A=LI()
    S=sum(A)
    A.sort(reverse=True)
    a=A[M-1]
    if a>=S/(4*M):
        print("Yes")
    else:
        print("No")

main()

Solution (Python):
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
A = A[::-1]
ans = []
s = sum(A)
for i in range(M):
    if A[i]>=s/(4*M):
        ans.append(A[i])
if len(ans)==M:
    print('Yes')
else:
    print('No')

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

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

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

A = list(map(int, input().split()))
t = 0
sum_A = sum(A)
for i in A:
    if i >= sum_A/ (4 * m):
        t += 1

if m <= t:
    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/(4*M):
        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()))
b=sum(a)/(4*m)
ans=0
for i in a:
    if i>=b:
        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)
K = 0
for a in A:
  if 4*M*a>=S: K+=1
print('Yes' if K>=M else 'No')

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

Asum = sum(A)
cnt = sum(a >= Asum / (4 * M) for a in A)
if cnt >= M:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):

import sys


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


res = 0
Total = sum(A)
for a in A:
    if a*4*M>=Total:
        res += 1
if res>=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()]
A.sort(reverse=True)
s = sum(A)
for a in A[:M]:
    if a < s/(4*M):
        print("No")
        break
else:
    print("Yes")

Solution (Python):
import sys
input=sys.stdin.readline
n,m=map(int,input().split())
a=list(map(int,input().split()))
all=sum(a)
c=0
for i in a:
    if i>=all/(4*m):
        c+=1
if c>=m:
    print('Yes')
else:
    print('No')

Solution (Python):
def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    s = sum(a)
    b = [i for i in a if i >= s/(4*m)]
    print(['No', 'Yes'][len(b) >= m])


main()

Solution (Python):
N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
S = sum(A)
th = S / (4*M)

res = 0
for i in A:
    if i>=th:
        res += 1

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

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

N,M = m()

a = l()
po = sum(a)
a.sort(reverse = True)
co = 0
for i in range(N):
    if a[i] >= po/(4*M):
        co += 1
if co >= M:
    print("Yes")
else:
    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 >= s / (4 * m):
        cnt += 1
if cnt >= m:
    print("Yes")
else:
    print("No")

Solution (Python):
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


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

S = sum(A)
cnt = 0
for a in A:
    cnt += a * 4 * M >= S
if cnt >= M:
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
import sys


def input():
    return sys.stdin.readline().strip()


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    s = sum(A)
    A.sort(reverse=True)
    for i in range(M):
        if A[i] >= s / (4 * M):
            continue
        else:
            print("No")
            break
    else:
        print("Yes")


if __name__ == "__main__":
    main()

Solution (Python):
N, M=map(int, input().split())
A=list(map(int, input().split()))
S=sum(A)
A.sort()
if A[-M]>=S/(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)

for i in range(M):
    if 4 * M * A[i] < sum(A):
        print('No')
        break

else:
    print('Yes')

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

res = 0
for a in A:
    if a >= sa:
        res += 1

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

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

count = 0
for i in A:
    if i >= s/(4*M):
        count += 1
print("YNeos"[count < M::2])

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

for i in A:
    if i>=S/M/4:
        c+=1

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

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

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

border = sum(A)

c = 0
for a in A:
    if border <= a*4*M:
        c += 1

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

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

cnt = 0
for i in a:
    cnt += sm <= (4 * m * i)
if cnt >= 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(" ")]

S=sum(A)
for i in sorted(A,reverse=True)[:M]:
    if i<S/(4*M):
        print("No")
        break
else:
    print("Yes")

Solution (Python):
from sys import stdin

def input():
	return stdin.readline()[:-1]

def intput():
	return int(input())

def sinput():
	return input().split()

def intsput():
	return map(int, sinput())

n, m = intsput()
ls = list(intsput())
ls = sorted(ls)
total = 0
for x in ls:
	total += x
crit = total / (4*m)
ls = ls[::-1]
if ls[m-1]>=crit:
	print("Yes")
else:
	print("No")

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
A = LIST()
sum_A = sum(A)
if sum([x >= sum_A/(4*M) for x in A]) >= M:
	print("Yes")
else:
	print("No")

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

b = sum(a) / (4.0 * m)
cnt = 0
for ai in a:
    if ai >= b:
        cnt += 1
ans = 'Yes' if cnt >= m else 'No'
print(ans)

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

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

Solution (Python):

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

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

AS = sum(A)

ans = 0

for i in range(N):

    if A[i] * 4 * M >= AS:
        ans += 1

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

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

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n, m = na()
a = na()
ok = 0
s = sum(a)
for v in a:
    if v*(4*m) >= s:
        ok += 1
if ok >= m:
    print("Yes")
else:
    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):
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
a = list(map(int, input().split()))
sm = sum(a)
t = 0
for i in range(N):
  if a[i] >= sm / (4 * M): t += 1
if t >= M: print("Yes")
else: print("No")