qyliang/CodeNanoFix huggingface dataset:
# Buggy code:
#amari = (10**100)%(10**9+7)
def sm(i):
    tmpp = 0
    for j in range(i):
        tmpp += j
    return tmpp,j

def bi(i,N):
    tmpp = 0
    for j in range(i):
        tmpp += N-j

    return tmpp,N-j

def main():
    N,K = map(int,input().split())
    ans = 0
    #loopnum = (N+1) - K + 1
    for i in range(K,N+2,1):
        if i == K:
            small,numsmall = sm(i)
            big,numbig = bi(i,N)
        else:
            small += numsmall+1
            numsmall += 1
            big += numbig - 1
            numbig -= 1 
        ans += big - small + 1

    return ans

print(main())


# Fixed code:
#amari = (10**100)%(10**9+7)
def sm(i):
    tmpp = 0
    for j in range(i):
        tmpp += j
    return tmpp,j

def bi(i,N):
    tmpp = 0
    for j in range(i):
        tmpp += N-j

    return tmpp,N-j

def main():
    N,K = map(int,input().split())
    ans = 0
    #loopnum = (N+1) - K + 1
    for i in range(K,N+2,1):
        if i == K:
            small,numsmall = sm(i)
            big,numbig = bi(i,N)
            #print(numsmall,numbig)
        else:
            small += numsmall+1
            numsmall += 1
            big += numbig - 1
            numbig -= 1
        ans += big - small + 1

    return (ans%(10**9+7))

print(main())
# Buggy code:
N, K = map(int, input().split())
mod = 10 ** 9 + 7
ans = 0
tmp = 0
for i in range(K-1):
  tmp += i
for i in range(K, N + 1):
  tmp += K - 1
  ans += K * N - tmp * 2 + 1
  ans = ans % mod
print(ans)
  

# Fixed code:
N,K = map(int,input().split())
mod = 10**9+7
ans = 0
for i in range(K,N+2):
  ans += (2*N-i+1)*i//2 - i*(i-1)//2 + 1

print(ans%mod)
# Buggy code:
import sys
input = sys.stdin.readline


def log(v):
    print(v, file=sys.stderr)


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

mod = 10**9 + 7
log(mod)
ans = 0
for i in range(K, N + 2):
    max = (N - i + 1 + N) * i / 2
    min = (i - 1) * i / 2
    ans += max - min + 1
    ans %= mod
print(ans)


# Fixed code:
import sys
input = sys.stdin.readline


def log(v):
    print(v, file=sys.stderr)


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

mod = 10**9 + 7
log(mod)
ans = 0
for i in range(K, N + 2):
    max = (N - i + 1 + N) * i // 2
    min = (i - 1) * i // 2
    ans += max - min + 1
    ans %= mod
print(ans)
# Buggy code:
data = input().split()
N = int(data[0])
K = int(data[1])
e = [n for n in range(N+1)]
print(e)
count = 0
for k in range(K,N+2):
    count += 2 * N - k * (k-1)
print(count//(10**9+7))

# Fixed code:
data = input().split()
N = int(data[0])
K = int(data[1])
e = [n for n in range(N+1)]
count = 0
for k in range(K,N+2):
    count += k * N - k * (k-1) + 1
print(count%(10**9+7))
# Buggy code:
N,K = map(int,input().split())
a =0
for i in range(K,N+2):
    a = a + ((N+N-i+1)*i/2-(i-1)*(i)/2+1)
print(a%10**9+7)

# Fixed code:
N,K = map(int,input().split())
a =0
for i in range(K,N+2):
    a = a + ((N+N-i+1)*i/2-(i-1)*(i)/2+1)
print(int(a % (10**9+7)))
# Buggy code:
import math
n,k = map(int,input().split()) 
ans = 0

bikkuri_n1 = math.factorial(n+1) % (10**9+7)

bikkuri_k = math.factorial(k) % (10**9+7)
for i in range(k,n+2):
  
    small = i*(i-1)//2
    big = i*(2*n-i+1)//2
    
    ans += big-small+1
    
  
    
print(ans)

# Fixed code:
n,k = map(int,input().split()) 
ans = 0

# bikkuri_n1 = math.factorial(n+1) % (10**9+7)

# bikkuri_k = math.factorial(k) % (10**9+7)

for i in range(k,n+2):
  
    small = i*(i-1)//2
    big = i*(2*n-i+1)//2
    
    ans += big-small+1
    ans %= (10**9+7)
    
  
    
print(ans)
# Buggy code:
import sys
import copy
from collections import deque
stdin = sys.stdin

mod = 10**9+7

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

n,k = na()

if n==k-1:
    print(1)
    exit(0)

prev_min = sum([i for i in range(k)])
prev_max = sum([i for i in range(n, n-k, -1)])
prev_num = k-1
cnt = 0
for i in range(n-k+1):
    # print("{} {} {}".format(prev_min, prev_max, prev_num))
    cnt += prev_max-prev_min+1
    cnt %= mod
    
    prev_min += prev_num+1
    prev_max += n-prev_num
    prev_num += 1

print(cnt)




# Fixed code:
import sys
import copy
from collections import deque
stdin = sys.stdin

mod = 10**9+7

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

n,k = na()

if n==k-1:
    print(1)
    exit(0)

prev_min = sum([i for i in range(k)])
prev_max = sum([i for i in range(n, n-k, -1)])
prev_num_min = k-1
prev_num_max = n-k+1
cnt = 0
for i in range(n-k+2):
    # print("{} {}".format(prev_min, prev_max))
    cnt += prev_max-prev_min+1
    cnt %= mod
    
    prev_num_min += 1
    prev_num_max -= 1
    prev_min += prev_num_min
    prev_max += prev_num_max

print(cnt)
# Buggy code:
n,k=map(int,input().split())

al=[0]*(n+1)
bl=[0]*(n+1)
bl[0]=n
for i in range(1,n+1):
    al[i]=i+al[i-1]
    bl[i]=(n+1-i-1)+bl[i-1]
    
ans=0
for i in range(k,n+2):
    ans+=bl[i-1]-al[i-1]+1
print(ans%(1e9+7))

# Fixed code:
n,k=map(int,input().split())

al=[0]*(n+1)
bl=[0]*(n+1)
bl[0]=n
for i in range(1,n+1):
    al[i]=i+al[i-1]
    bl[i]=(n+1-i-1)+bl[i-1]
    
ans=0
for i in range(k,n+2):
    ans+=bl[i-1]-al[i-1]+1
print(ans%(10**9+7))
# Buggy code:
n,k=map(int,input().split())
sum=0
M=1000000007
print(((2*n-k+1)*k)/2,(k*(k-1))/2)
for i in range(k,n+2):
    sum=(2*n-i+1)*i/2-(i*(i-1))/2+1+sum
    sum=sum%M
print(int(sum)%M)

# Fixed code:
n,k=map(int,input().split())
sum=0
M=1000000007
for i in range(k,n+2):
    sum=(2*n-i+1)*i/2-(i*(i-1))/2+1+sum
    sum=sum%M
print(int(sum)%M)
# Buggy code:
N, K = map(int, input().split())
mod = 10**9 + 7 
ans = 0 
for i in range(K, N + 2): 
        l = N - i + 1 
        ans += ((N + l) * (N - l + 1) // 2) - ((i - 1)*i // 2)
print(ans % mod)

# Fixed code:
N, K = map(int, input().split())
mod = 10**9 + 7 
ans = 0 
for i in range(K, N + 2): 
        ans += (((N*(N + 1) // 2) - ((N - i)*(N - i + 1) // 2)) - ((i - 1)*i // 2) + 1) % mod 
print(ans % mod)
# Buggy code:
N,K = map(int,input().split())
ans = 0
mod = 10**9+7
for k in range(K,N+2):
    ans += (k*(N-k+1)+1) % mod
print(ans)


# Fixed code:
N,K = map(int,input().split())
ans = 0
mod = 10**9+7
for k in range(K,N+2):
    ans += (k*(N-k+1)+1)
print(ans % mod)
# Buggy code:
N,K = map(int,input().split())
M = 10**9 + 7
T = pow(10,100,M)
ans = 0
for k in range(K, N+2):
    ans += (2*N-k+1)*k//2 - k*(k-1)//2 + 1
print(ans)

# Fixed code:
N,K = map(int,input().split())
M = 10**9 + 7
T = pow(10,100,M)
ans = 0
for k in range(K, N+2):
    ans += (2*N-k+1)*k//2 - k*(k-1)//2 + 1
    ans %= M
print(ans)
# Buggy code:
n,k=map(int,input().split())
count=0
for i in range(n+1):
    if i<k:
        continue
    elif i>=k:
        mini=i*(i-1)//2
        a=n*(n+1)//2
        b=(n-i)*(n-i+1)//2
        maxi=a-b
        total=maxi-mini+1
        count+=total
print(count%(10**9+7))
        

# Fixed code:
n,k=map(int,input().split())
count=0
for i in range(n+2):
    if i<k:
        continue
    elif i>=k:
        mini=i*(i-1)//2
        a=n*(n+1)//2
        b=(n-i)*(n-i+1)//2
        maxi=a-b
        total=maxi-mini+1
        count+=total
ans=count%(10**9+7)
print(ans)
# Buggy code:
n,k = map(int,input().split())
ans = 0

for i in range(k,n+2):
    ans += (i*(n-i+1) + 1)

print(ans)

# Fixed code:
n,k = map(int,input().split())
ans = 0

for i in range(k,n+2):
    ans += (i*(n-i+1) + 1)

ans %= 1000000007
print(ans)
# Buggy code:
def main():
    n, k = map(int, input().split())

    num = 10*100
    nums = [num + i for i in range(0, n+1)]

    # sums = []
    total = 0
    for i in range(k, n+2):
        _min = int((nums[0]+nums[i-1])*(nums[i-1]-nums[0]+1)/2)
        _max = int((nums[-i]+nums[-1])*(nums[-1]-nums[-i]+1)/2)

        total += _max - _min + 1

    print(total)

if __name__ == "__main__":
    main()

# Fixed code:
def main():
    n, k = map(int, input().split())

    num = 10*100
    nums = [num + i for i in range(0, n+1)]

    # sums = []
    total = 0
    for i in range(k, n+2):
        _min = int((nums[0]+nums[i-1])*(nums[i-1]-nums[0]+1)/2)
        _max = int((nums[-i]+nums[-1])*(nums[-1]-nums[-i]+1)/2)

        total += _max - _min + 1

    print(total%(10**9+7))

if __name__ == "__main__":
    main()
# Buggy code:
n,k = map(int,input().split())
total = 0
for i in range(k,n+2):
    m = sum(range(0,i))
    M = sum(range(n-i+1,n+1))
    total += M - m + 1
print(total % (10**9 + 7))

# Fixed code:
n,k = map(int,input().split())
total = 0
for i in range(k,n+2):
    m = i*(i-1)//2
    M = i*n-(i*(i-1))//2
    total += M - m + 1
print(total % (10**9 + 7))
# Buggy code:
n, k = map(int, input().split())

a = 0

for i in range(k, n+2):
    a += n*k + k - k**2 + 1

ans = a % (10**9+7)
print(ans)

# Fixed code:
MOD=10**9+7
n, k = map(int, input().strip().split())
ans=0
for i in range(k,n+2):
    ans+=i*(n-i+1)+1
    ans%=MOD
print(ans)
# Buggy code:
N, K = map(int, input().split())
ans = 0
for i in range(K,N+2):
    ans += N*i -i**2 +i +1
print(ans)

# Fixed code:
N, K = map(int, input().split())
ans = 0
for i in range(K, N+2):
    ans += i*(N-i+1)+1

print(ans%1000000007)
# Buggy code:
N, K = map(int, input().split())
MOD = 10 ** 9 + 7

LOW, HIGH = 0, N
ans = 0

if K >= 1:
    ans += (HIGH - LOW + 1)

for i in range(2, N + 2):
    LOW += i - 1
    HIGH += N - i + 1
    LOW %= MOD
    HIGH %= MOD
    if i >= K:
        ans += (HIGH - LOW + 1)
        ans %= MOD

print(ans)


# Fixed code:
N, K = map(int, input().split())
MOD = 10 ** 9 + 7

LOW, HIGH = 0, N
ans = 0

if 1 >= K:
    ans += (HIGH - LOW + 1)

for i in range(2, N + 2):
    LOW += i - 1
    HIGH += N - i + 1
    LOW %= MOD
    HIGH %= MOD
    if i >= K:
        ans += (HIGH - LOW + 1)
        ans %= MOD

print(ans)
# Buggy code:
N,K=map(int,input().split())
ans=0
for i in range(K,N+2):
    tmp=i*N-2*sum(range(0,i))+1
    ans+=tmp
    ans%=(10**9+7)
print(ans)

# Fixed code:
N,K=map(int,input().split())
ans=0
for i in range(K,N+2):
    tmp=i*N-(i-1)*i+1
    ans+=tmp
    ans%=(10**9+7)
print(ans)
# Buggy code:
N,K=map(int,input().split())
n=[i for i in range(N+1)]
mod=10**9+7141421 35623

min_value=[0]*(N+1)
max_value=[0]*(N+1)
min_value[0]=0
max_value[0]=N
for i in range(1,N+1):
  min_value[i]=min_value[i-1]+n[i]
  max_value[i]=max_value[i-1]+n[-(i+1)]

ans=0
for i in range(K-1,N+1):
  ans+=max_value[i]-min_value[i]+1
  ans%=mod
print(ans)

# Fixed code:
N,K=map(int,input().split())
n=[i for i in range(N+1)]
mod=10**9+7

min_value=[0]*(N+1)
max_value=[0]*(N+1)
min_value[0]=0
max_value[0]=N
for i in range(1,N+1):
  min_value[i]=min_value[i-1]+n[i]
  max_value[i]=max_value[i-1]+n[-(i+1)]

ans=0
for i in range(K-1,N+1):
  ans+=max_value[i]-min_value[i]+1
  ans%=mod
print(ans)
# Buggy code:
n,k=map(int,input().split())
s=[]
count=0
for i in range(n+1):
  count+=i
  s.append(count)

t=[]
for i in range(n+1):
  tmp=0
  for j in range(i+1):
    tmp+=n-j
  t.append(tmp)

ans=0
for i in range(k-1,n+1):
  ans+=t[i]-s[i]+1
  ans%=(10**9+7)

print(ans)

# Fixed code:
n,k=map(int,input().split())
s=[]
count=0
for i in range(n+1):
  count+=i
  s.append(count)

t=[n]
tmp=n
for i in range(1,n+1):
  tmp-=1
  t.append(t[i-1]+tmp)
# print(t)

ans=0
for i in range(k-1,n+1):
  ans+=t[i]-s[i]+1
  ans%=(10**9+7)

print(ans)
# Buggy code:
n,k=map(int,input().split())
mod=10**9+7
def f(n):
  return n*(n-1)//2
ans=0
for i in range(k,n+2):
  a=f(n+1)-f(n-k-i)-f(k+i)+1
  ans+=a%mod
print(ans%mod)

# Fixed code:
n,k=map(int,input().split())
mod=10**9+7
def f(n):
  mod=10**9+7
  return (n*(n+1)//2)%mod
ans=0
for i in range(k,n+2):
  a=f(n)-f(n-i)-f(i-1)+1
  ans+=(a%mod)
print(ans%mod)
# Buggy code:
from itertools import permutations, combinations

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

ans = 0
_list = list(range(N+1))
_list.sort(reverse = True)
h = _list[0]
l = 0
cnt = 0

if N == K == 1:
    print(2)
    exit()
for i in range(1, N+1):
    h += _list[i]
    cnt += 1
    l += cnt
    print(i , h , l)
    if i >= K-1:
        ans += h - l + 1

    
print(ans%(10**9 + 7))

# Fixed code:
from itertools import permutations, combinations

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

ans = 0
_list = list(range(N+1))
_list.sort(reverse = True)
h = 0
l = 0
cnt = -1

for i in range(N+1):
    h += _list[i]
    cnt += 1
    l += cnt
    if i >= K-1:
        ans += h - l + 1
        
print(ans%(10**9 + 7))
# Buggy code:
n,K = map(int, input().split(' '))

#n,k = 3, 2

res = 0

for k in range(K, n+2):
  first = k * (k-1) / 2
  last = (2 * n - k + 1) * k / 2
  res += (last - first + 1) % (10**9+7)
print(int(res))

# Fixed code:
n,K = map(int, input().split(' '))

#n,k = 3, 2

res = 0

for k in range(K, n+2):
  first = k * (k-1) / 2
  last = (2 * n - k + 1) * k / 2
  res += (last - first + 1) 
print(int(res%(10**9+7)))
# Buggy code:
n,m = map(int,input().split())
A = list(input().split())
B = sum(A)
a = 0
for i in range(n):
    if A[i] >= B/(4*m):
        a += 1
if a >= m:
    print("Yes")
else:
    print("No")

# Fixed code:
n,m = map(int,input().split())
A = [int(x) for x in input().split()]
B = sum(A)
a = 0
for i in range(n):
    if A[i] >= B/(4*m):
        a += 1
if a >= m:
    print("Yes")
else:
    print("No")
# Buggy code:
n,m=map(int,input().split())
a=[int(i) for i in input().split()]
count=0

A=sum(a)//(4＊m)
for i in range(n):
  if a[i]>A:
    count+=1
if count>=m:
  print("Yes")
else:
  print("No")

# Fixed code:
n,m=map(int,input().split())
a=[int(i) for i in input().split()]
count=0
 
A=sum(a)/(4*m)
for i in a:
  if i>=A:
    count+=1
if count>=m:
  print("Yes")
else:
  print("No")
# Buggy code:

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

#print(M)
A.sort()
#print(A)
limit = sum(A)/(4*M)
#print(limit)
count = 0
for i in range(N):
    if A[i] > limit:
        count +=1

print(count)

#print(N-n-1)
if count > M:
    print("Yes")
else:
    print("No")

# Fixed code:
N, M = map(int,input().split())
A = list(map(int,input().split()))

#print(M)
A.sort()
#print(A)
limit = sum(A)/(4*M)
#print(limit)
count = 0
for i in range(N):
    if A[i] >= limit:
        count +=1

#print(count)

#print(N-n-1)
if count >= M:
    print("Yes")
else:
    print("No")
# Buggy code:
nums = list(map(int, input().split()))
n = nums[0]
m = nums[1]

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

sum = 0
for v in a:
  sum += v

result = []
for s in a:
    if s >= sum * (1 / (4 * m)):
        result.append(s)
print(result)
if len(result) >= m:
    print("Yes")
else:
    print("No")


# Fixed code:
nums = list(map(int, input().split()))
n = nums[0]
m = nums[1]

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

sum = 0
for v in a:
  sum += v

result = []
for s in a:
    if s >= sum * (1 / (4 * m)):
        result.append(s)
if len(result) >= m:
    print("Yes")
else:
    print("No")
# Buggy code:
n,m=map(int,input().split())
a=list(map(int,input().split()))

limit=sum(a)/(4*m)
c=0
for aa in a:
  if a >=limit:
    c+=1
  else:
    pass
if c==0:
  print('No')
else:
  print('Yes')

# Fixed code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
     
limit=sum(a)/(4*m)
c=0
for aa in a:
  if aa >=limit:
    c+=1
  else:
    pass
if c>=m:
  print('Yes')
else:
  print('No')
# Buggy code:
nm = input('')
n = int(nm.split(' ')[0])
m = int(nm.split(' ')[1])
alist = input('').split(' ')

t = 0
for i in range(n):
  t += int(alist[i])
lm = t/(m*4)
print(lm)
s = 0
for i in range(n):
  a = int(alist[i])
  if a > lm:
    s+=1

if s > m:
  print('Yes')
else:
  print('No')



# Fixed code:
nm = input('')
n = int(nm.split(' ')[0])
m = int(nm.split(' ')[1])
alist = input('').split(' ')

t = 0
for i in range(n):
  t += int(alist[i])

  s = 0
for i in range(n):
  a = int(alist[i])
  if a*4*m >= t:
    s+=1

if s >= m:
  print('Yes')
else:
  print('No')
# Buggy code:
import math
n, m = map(int,input().split())
a = list(map(int,input().split()))
sum = sum(a)
print(sum)
x = 0
for i in a:
    if i >= (math.ceil(sum / 4 * m)):
        x += 1

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


# Fixed code:
import math
n, m = map(int,input().split())
a = list(map(int,input().split()))
sum = sum(a)

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


if x >= m:
    print('Yes')
else:
    print('No')
# Buggy code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
count = 0

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

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

# Fixed code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
count = 0
s = sum(a)

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

if m <= count:
  print('Yes')
else:
  print('No')
# Buggy code:
N, M = list(map(int, input().split()))
A = sorted(map(int, input().split()), reverse=True)
print(N, M , A, sum(A))

border = sum(A) // (4*M)
flag = 'Yes'

for i in range(M):
    if border > A[i]:
        flag = 'No'

print(flag)


# Fixed code:
import math

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

border = sum(A) / (4*M)
flag = 'Yes'

for i in range(M):
    if border > A[i]:
        flag = 'No'

print(flag)
# Buggy code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)
ans = "Yes"
for i in range(n):
    if a[i] < sum(a)*(1/(4*m)):
        ans = "No"
        break
print(ans)

# Fixed code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
ans = "Yes"

a.sort(reverse=True)

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

print(ans)
# Buggy code:
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
count = N
for a in A:
  if a < N / (4 * M):
    count -= 1
if count < M:
  print('No')
else:
  print('Yes')

# Fixed code:
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
count = N
X = sum(A)
for a in A:
  if a < X / (4 * M):
    count -= 1
if count < M:
  print('No')
else:
  print('Yes')
# Buggy code:
a,b = map(int, input().split())
List = list(map(int, input().split()))
c = sum(List)
List = sorted(List)[::-1]
d = List(b-1)
if d < c/4/b;
	print("No")
elif
	print("Yes")

# Fixed code:
a,b = map(int, input().split())
List = list(map(int, input().split()))
c = sum(List)
List = sorted(List)[::-1]
d = List[b-1]
if d < c/4/b:
	print("No")
else:
	print("Yes")
# Buggy code:
A=list(map(int,input().split()))
pop = 1/(4*M)*sum(A)
lis = []

for i in A:
    if i>pop:
        lis.append(i)
if len(lis)>=M:
    print("Yes")
else:
    print("No")

# Fixed code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
pop = 1/(4*M)*sum(A)
lis = []
for i in A:
    if i>=pop:
        lis.append(i)
if len(lis)>=M:
    print("Yes")
else:
    print("No")
# Buggy code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
if a[-m]<1/(4*m):
  print("No")
else:
  print("Yes")

# Fixed code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
l=sum(a)
a.sort()
if a[-m]<l/(4*m):
  print("No")
else:
  print("Yes")
# Buggy code:
n,m = map(int,input().split())
ai = list(map(int,input().split()))
s = sum(ai)
check = s/4/m
count = 0
for i in ai:
  if i > round(check, 0):
    print(round(check, 0))
    count += 1
if count >= m:
  print('Yes')
else:
  print('No')

# Fixed code:
n,m = map(int,input().split())
ai = list(map(int,input().split()))
s = sum(ai)
count = 0
for i in ai:
  if i >= s/(4*m):
    count += 1
if count >= m:
  print('Yes')
else:
  print('No')
# Buggy code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
a = sorted(a,reverse = True)
x = sum(a)
if a[m-1]<(x//4):
  print("No")
else:
  print("Yes")

# Fixed code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
a = sorted(a,reverse = True)
x = sum(a)
if a[m-1]<(x/(4*m)):
  print("No")
else:
  print("Yes")
# Buggy code:
N,M = map(int, input().split())
x = input()
total_vote = sum(x)
count = 0
for y in x:
    if y >=(total_vote/(4*M)):
        count+=1
      
if count>=M:
    print('Yes')
else:
    print('No')


# Fixed code:
N,M = map(int, input().split())
x = list(map(int, input().split()))
total_vote = sum(x)
count = 0
for y in x:
    if y >=(total_vote/(4*M)):
        count+=1
      
if count>=M:
    print('Yes')
else:
    print('No')
# Buggy code:
n,m = map(int, input().split())
a = list(map(int, input().split()))
a = [i for i in a if i >= sum(a)/4*m]
if len(a) < m:
  print("No")
else:
  print("Yes")

# Fixed code:
n,m = map(int, input().split())
a = list(map(int, input().split()))
b = [i for i in a if i >= sum(a)/4/m]
if len(b) < m:
  print("No")
else:
  print("Yes")
# Buggy code:
n,m = map(int,input().split())
a = list(map(int,input().split()))

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

# Fixed code:
n,m = map(int,input().split())
a = list(map(int,input().split()))

sum = 0
for i in range(n):
    sum = sum + a[i]
sum_divided = sum/(4*m)
cnt = 0
for i in range(n):
    if a[i] >= sum_divided:
        cnt = cnt + 1
if cnt >= m:
    print('Yes')
else:
    print('No')
# Buggy code:
data = input().split()

n = int(data[0])
m = int(data[1])

pro = [int(s) for s in input().split()]

vote = 0
for i in pro:
  vote += i

s_pro = sorted(pro, reverse=True)

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


# Fixed code:
data = input().split()
 
n = int(data[0])
m = int(data[1])
 
pro = [int(s) for s in input().split()]
 
vote = 0
for i in pro:
  vote += i
 
s_pro = sorted(pro, reverse=True)

if s_pro[m - 1] < vote * 1 / (4 * m):
  print("No")
else:
  print("Yes")
# Buggy code:
n,m = input().split()n,m = input().split()
n = int(n)
m = int(m)
arr = list(map(int,input().split()))
minn = sum(arr)*(1/(4*m))
t = 0
for i in arr:
  if i >= minn:
    t += 1
if t >= m:
  print("Yes")
else:
  print("No")

# Fixed code:
n,m = input().split()
n = int(n)
m = int(m)
arr = list(map(int,input().split()))
minn = sum(arr)*(1/(4*m))
t = 0
for i in arr:
  if i >= minn:
    t += 1
#print(t)
if t >= m:
  print("Yes")
else:
  print("No")
# Buggy code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
if A[M-1] < sum(A)/(4*M):
  print('No')
else
  print('Yes')


# Fixed code:
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')
# Buggy code:
N, M = map(int, input().split())
A = list(map(int, input().split()))

total_votes_checker = lambda M, i, total_votes: (False if i <= (1 / (4 * M)) * total_votes else True)

A = list(filter(lambda i: total_votes_checker(M, i, total_votes), A))

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



# Fixed code:
N, M = map(int, input().split())
A = list(map(int, input().split()))

total_votes = sum(A)

total_votes_checker = lambda M, i, total_votes: (False if i < (1 / (4 * M)) * total_votes else True)

A = list(filter(lambda i: total_votes_checker(M, i, total_votes), A))

print("Yes") if len(A) >= M else print("No")
# Buggy code:
n, m = map(int, input().split())
a_list = list(map(int, input().split()))

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

cnt = 0
for i in a_list:
    if cnt == m:
        print('Yes')
        exit()

    if i >= border:
        cnt += 1

print('No')


# Fixed code:
n, m = map(int, input().split())
a_list = list(map(int, input().split()))

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

cnt = 0
for i in a_list:
    if cnt == m:
        print('Yes')
        exit()

    if i >= border:
        cnt += 1

if cnt >= m:
    print('Yes')
else:
    print('No')
# Buggy code:
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")
else:
print("No")

# Fixed code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
S = sum(A)

cnt = 0
for a in A:
    if S / (4 * M) <= a:
        cnt += 1

ans = 'Yes' if cnt >= M else 'No'
print(ans)
# Buggy code:
N,M = list(map(int, input().split()))

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

print(A)

Asum = sum(A)

for i in range(M):
    Amax =  max(A)
    max_index = A.index(Amax)
    A.pop(max_index)
    

if Amax < Asum/4/M:
    print('No')
else:
    print('Yes')

# Fixed code:
N,M = list(map(int, input().split()))

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

Asum = sum(A)

for i in range(M):
    Amax =  max(A)
    max_index = A.index(Amax)
    A.pop(max_index)
    

if Amax < Asum/4/M:
    print('No')
else:
    print('Yes')