Buggy python submission (verdict: Runtime Error):
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
  if  A[i]*M*4>=K:
    if i==N-1:
      breakflag=1
    continue
  else:
    answer=i
    break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")

Fixed submission:
N,M=map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
  if  A[i]*M*4>=K:
    if i==N-1:
      breakflag=1
    continue
  else:
    answer=i
    break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N,M= map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
    if  A[i]*M*4>=K:
    	if i==N-1:
        	breakflag=1
      	continue
    else:
      	answer=i
      	break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")

Fixed submission:
N,M=map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
  if  A[i]*M*4>=K:
    if i==N-1:
      breakflag=1
    continue
  else:
    answer=i
    break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N,M= map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
for i in range(0,N):
    if  A[i]*M*4>=K:
        continue
    else:
        answer=i
        break
if answer>=M:
    print("Yes")
else:
    print("No")

Fixed submission:
N,M=map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
  if  A[i]*M*4>=K:
    if i==N-1:
      breakflag=1
    continue
  else:
    answer=i
    break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N,M= map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
for i in range(0,N):
    if  A[i]>=K/(4*M):
        continue
    else:
        answer=i+1
        break
if answer>=M:
    print("Yes")
else:
    print("No")

Fixed submission:
N,M=map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
  if  A[i]*M*4>=K:
    if i==N-1:
      breakflag=1
    continue
  else:
    answer=i
    break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N,M= map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
for i in range(0,N):
    if  A[i]>K/(4*M):
        continue
    else:
        answer=i+1
        break
if answer>=M:
    print("Yes")
else:
    print("No")


Fixed submission:
N,M=map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
  if  A[i]*M*4>=K:
    if i==N-1:
      breakflag=1
    continue
  else:
    answer=i
    break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N,M= map(int, raw_input().split())
A=list(map(int, raw_input().split()))
A.sort()
A.reverse()
K=sum(A)
for i in range(0,N):
    if  A[i]>K/(4*M):
        continue
    else:
        answer=i+1
        break
if answer>=M:
    print("Yes")
else:
    print("No")


Fixed submission:
N,M=map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
  if  A[i]*M*4>=K:
    if i==N-1:
      breakflag=1
    continue
  else:
    answer=i
    break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")