program ABC161B
    implicit none
    integer(8)::N,M,a_select,i,A_all
    integer(8),allocatable,dimension(:)::A
    read*,N,M
    allocate(A(N))
    read*,A
    a_select=0
    A_all=sum(A)

    do i=1,N
        if(4*M*A(i)>=A_all)a_select=a_select+1
    end do

    if(a_select>=M)then
        print'(A)',"Yes"
    else
        print'(A)',"No"
    end if
end program ABC161B
; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QFEa.0 = internal unnamed_addr global ptr null
@_QFEa.8 = internal unnamed_addr global i64 0
@_QQcl.ae9eea39ad9db2e89050fa769ae525e6 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1868/source.f\00"
@_QQcl.284129 = linkonce constant [3 x i8] c"(A)"
@_QQcl.596573 = linkonce constant [3 x i8] c"Yes"
@_QQcl.4E6F = linkonce constant [2 x i8] c"No"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ae9eea39ad9db2e89050fa769ae525e6, i32 5)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 8)
  %6 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %2, i32 8)
  %7 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %8 = load i64, ptr %3, align 8, !tbaa !3
  %9 = call i64 @llvm.smax.i64(i64 %8, i64 0)
  %10 = shl i64 %9, 3
  %11 = call ptr @malloc(i64 %10)
  store ptr %11, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %9, ptr @_QFEa.8, align 8, !tbaa !7
  %12 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ae9eea39ad9db2e89050fa769ae525e6, i32 7)
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack138.unpack.unpack140 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  store ptr %.unpack, ptr %1, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 8, ptr %.fca.1.gep, align 8, !tbaa !7
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 10, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  store i64 %.unpack138.unpack.unpack140, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  store i64 8, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %13 = call i1 @_FortranAioInputDescriptor(ptr %12, ptr nonnull %1)
  %14 = call i32 @_FortranAioEndIoStatement(ptr %12)
  %.unpack143 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack150.unpack.unpack152 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  %15 = icmp sgt i64 %.unpack150.unpack.unpack152, 0
  br i1 %15, label %.lr.ph.i.preheader, label %_FortranASumInteger8x1_contract_simplified.exit

.lr.ph.i.preheader:                               ; preds = %0
  %min.iters.check = icmp ult i64 %.unpack150.unpack.unpack152, 4
  br i1 %min.iters.check, label %.lr.ph.i.preheader171, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.i.preheader
  %n.vec = and i64 %.unpack150.unpack.unpack152, -4
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
  %vec.phi169 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ]
  %16 = shl i64 %index, 3
  %17 = getelementptr i8, ptr %.unpack143, i64 %16
  %wide.load = load <2 x i64>, ptr %17, align 8, !tbaa !3
  %18 = getelementptr i64, ptr %17, i64 2
  %wide.load170 = load <2 x i64>, ptr %18, align 8, !tbaa !3
  %19 = add <2 x i64> %wide.load, %vec.phi
  %20 = add <2 x i64> %wide.load170, %vec.phi169
  %index.next = add nuw i64 %index, 4
  %21 = icmp eq i64 %index.next, %n.vec
  br i1 %21, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %20, %19
  %22 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %.unpack150.unpack.unpack152, %n.vec
  br i1 %cmp.n, label %_FortranASumInteger8x1_contract_simplified.exit, label %.lr.ph.i.preheader171

.lr.ph.i.preheader171:                            ; preds = %.lr.ph.i.preheader, %middle.block
  %.ph = phi i64 [ 0, %.lr.ph.i.preheader ], [ %22, %middle.block ]
  %.ph172 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.lr.ph.i.preheader171, %.lr.ph.i
  %23 = phi i64 [ %28, %.lr.ph.i ], [ %.ph, %.lr.ph.i.preheader171 ]
  %24 = phi i64 [ %29, %.lr.ph.i ], [ %.ph172, %.lr.ph.i.preheader171 ]
  %25 = shl i64 %24, 3
  %26 = getelementptr i8, ptr %.unpack143, i64 %25
  %27 = load i64, ptr %26, align 8, !tbaa !3
  %28 = add i64 %27, %23
  %29 = add nuw nsw i64 %24, 1
  %exitcond.not.i = icmp eq i64 %29, %.unpack150.unpack.unpack152
  br i1 %exitcond.not.i, label %_FortranASumInteger8x1_contract_simplified.exit, label %.lr.ph.i, !llvm.loop !12

_FortranASumInteger8x1_contract_simplified.exit:  ; preds = %.lr.ph.i, %middle.block, %0
  %.lcssa.i = phi i64 [ 0, %0 ], [ %22, %middle.block ], [ %28, %.lr.ph.i ]
  %30 = load i64, ptr %3, align 8, !tbaa !3
  %31 = icmp sgt i64 %30, 0
  %32 = load i64, ptr %2, align 8, !tbaa !3
  br i1 %31, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %_FortranASumInteger8x1_contract_simplified.exit
  %33 = shl i64 %32, 2
  %xtraiter = and i64 %30, 1
  %34 = icmp eq i64 %30, 1
  br i1 %34, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %30, -2
  br label %35

35:                                               ; preds = %35, %.lr.ph.new
  %36 = phi i64 [ 1, %.lr.ph.new ], [ %46, %35 ]
  %.0168 = phi i64 [ 0, %.lr.ph.new ], [ %spec.select.1, %35 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %35 ]
  %37 = add nsw i64 %36, -1
  %38 = getelementptr i64, ptr %.unpack143, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !3
  %40 = mul i64 %33, %39
  %.not167 = icmp sge i64 %40, %.lcssa.i
  %41 = zext i1 %.not167 to i64
  %spec.select = add i64 %.0168, %41
  %42 = getelementptr i64, ptr %.unpack143, i64 %36
  %43 = load i64, ptr %42, align 8, !tbaa !3
  %44 = mul i64 %33, %43
  %.not167.1 = icmp sge i64 %44, %.lcssa.i
  %45 = zext i1 %.not167.1 to i64
  %spec.select.1 = add i64 %spec.select, %45
  %46 = add nuw i64 %36, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa.loopexit, label %35

._crit_edge.loopexit.unr-lcssa.loopexit:          ; preds = %35
  %47 = add i64 %36, 1
  br label %._crit_edge.loopexit.unr-lcssa

._crit_edge.loopexit.unr-lcssa:                   ; preds = %._crit_edge.loopexit.unr-lcssa.loopexit, %.lr.ph
  %spec.select.lcssa.ph = phi i64 [ undef, %.lr.ph ], [ %spec.select.1, %._crit_edge.loopexit.unr-lcssa.loopexit ]
  %.unr = phi i64 [ 0, %.lr.ph ], [ %47, %._crit_edge.loopexit.unr-lcssa.loopexit ]
  %.0168.unr = phi i64 [ 0, %.lr.ph ], [ %spec.select.1, %._crit_edge.loopexit.unr-lcssa.loopexit ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %48 = getelementptr i64, ptr %.unpack143, i64 %.unr
  %49 = load i64, ptr %48, align 8, !tbaa !3
  %50 = mul i64 %33, %49
  %.not167.epil = icmp sge i64 %50, %.lcssa.i
  %51 = zext i1 %.not167.epil to i64
  %spec.select.epil = add i64 %.0168.unr, %51
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %_FortranASumInteger8x1_contract_simplified.exit
  %.0.lcssa = phi i64 [ 0, %_FortranASumInteger8x1_contract_simplified.exit ], [ %spec.select.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %spec.select.epil, %._crit_edge.loopexit.epilog-lcssa ]
  %.not = icmp slt i64 %.0.lcssa, %32
  br i1 %.not, label %55, label %52

52:                                               ; preds = %._crit_edge
  %53 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.284129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.ae9eea39ad9db2e89050fa769ae525e6, i32 16)
  %54 = call i1 @_FortranAioOutputAscii(ptr %53, ptr nonnull @_QQcl.596573, i64 3)
  br label %58

55:                                               ; preds = %._crit_edge
  %56 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.284129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.ae9eea39ad9db2e89050fa769ae525e6, i32 18)
  %57 = call i1 @_FortranAioOutputAscii(ptr %56, ptr nonnull @_QQcl.4E6F, i64 2)
  br label %58

58:                                               ; preds = %52, %55
  %.sink = phi ptr [ %53, %52 ], [ %56, %55 ]
  %59 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  ret void
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputAscii(ptr, ptr, i64) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #2

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(none) }

!llvm.module.flags = !{!0, !1, !2}

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !11, !10}
