program bm
    implicit none
    integer::N,M
    integer,allocatable,dimension(:)::A
    integer::SUMA,CNT=0
    integer::i
    read*,N,M
    allocate(A(N))
    read*,A
    SUMA=sum(A)
    do i=1,N
        if(A(I)*4*M>=SUMA)cnt=cnt+1
    end do
    print"(A)",trim(merge("Yes","No ",CNT>=M))
end program bm
; 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
@_QFEcnt = internal unnamed_addr global i32 0
@_QQcl.3d074a16c45063b17f842d241e87bcf7 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1865/source.f\00"
@_QQcl.284129 = linkonce constant [3 x i8] c"(A)"
@_QQcl.596573 = linkonce constant [3 x i8] c"Yes"
@_QQcl.4E6F20 = linkonce constant [3 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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.3d074a16c45063b17f842d241e87bcf7, i32 7)
  %7 = call i1 @_FortranAioInputInteger(ptr %6, ptr nonnull %5, i32 4)
  %8 = call i1 @_FortranAioInputInteger(ptr %6, ptr nonnull %4, i32 4)
  %9 = call i32 @_FortranAioEndIoStatement(ptr %6)
  %10 = load i32, ptr %5, align 4, !tbaa !3
  %11 = call i32 @llvm.smax.i32(i32 %10, i32 0)
  %12 = zext i32 %11 to i64
  %13 = shl nuw nsw i64 %12, 2
  %14 = call ptr @malloc(i64 %13)
  store ptr %14, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %12, ptr @_QFEa.8, align 8, !tbaa !7
  %15 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.3d074a16c45063b17f842d241e87bcf7, i32 9)
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack240.unpack.unpack242 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  store ptr %.unpack, ptr %2, align 8, !tbaa !7
  %.fca.1.gep75 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep75, align 8, !tbaa !7
  %.fca.2.gep77 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep77, align 8, !tbaa !7
  %.fca.3.gep79 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep79, align 4, !tbaa !7
  %.fca.4.gep81 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep81, align 1, !tbaa !7
  %.fca.5.gep83 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep83, align 2, !tbaa !7
  %.fca.6.gep85 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep85, align 1, !tbaa !7
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, 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 %2, i64 0, i32 7, i64 0, i64 1
  store i64 %.unpack240.unpack.unpack242, 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 %2, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %16 = call i1 @_FortranAioInputDescriptor(ptr %15, ptr nonnull %2)
  %17 = call i32 @_FortranAioEndIoStatement(ptr %15)
  %.unpack245 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack252.unpack.unpack254 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  %18 = icmp sgt i64 %.unpack252.unpack.unpack254, 0
  br i1 %18, label %.lr.ph.i.preheader, label %_FortranASumInteger4x1_contract_simplified.exit

.lr.ph.i.preheader:                               ; preds = %0
  %min.iters.check = icmp ult i64 %.unpack252.unpack.unpack254, 8
  br i1 %min.iters.check, label %.lr.ph.i.preheader273, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.i.preheader
  %n.vec = and i64 %.unpack252.unpack.unpack254, -8
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %22, %vector.body ]
  %vec.phi271 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %23, %vector.body ]
  %19 = shl i64 %index, 2
  %20 = getelementptr i8, ptr %.unpack245, i64 %19
  %wide.load = load <4 x i32>, ptr %20, align 4, !tbaa !3
  %21 = getelementptr i32, ptr %20, i64 4
  %wide.load272 = load <4 x i32>, ptr %21, align 4, !tbaa !3
  %22 = add <4 x i32> %wide.load, %vec.phi
  %23 = add <4 x i32> %wide.load272, %vec.phi271
  %index.next = add nuw i64 %index, 8
  %24 = icmp eq i64 %index.next, %n.vec
  br i1 %24, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %23, %22
  %25 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %.unpack252.unpack.unpack254, %n.vec
  br i1 %cmp.n, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i.preheader273

.lr.ph.i.preheader273:                            ; preds = %.lr.ph.i.preheader, %middle.block
  %.ph = phi i32 [ 0, %.lr.ph.i.preheader ], [ %25, %middle.block ]
  %.ph274 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.lr.ph.i.preheader273, %.lr.ph.i
  %26 = phi i32 [ %31, %.lr.ph.i ], [ %.ph, %.lr.ph.i.preheader273 ]
  %27 = phi i64 [ %32, %.lr.ph.i ], [ %.ph274, %.lr.ph.i.preheader273 ]
  %28 = shl i64 %27, 2
  %29 = getelementptr i8, ptr %.unpack245, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !3
  %31 = add i32 %30, %26
  %32 = add nuw nsw i64 %27, 1
  %exitcond.not.i = icmp eq i64 %32, %.unpack252.unpack.unpack254
  br i1 %exitcond.not.i, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i, !llvm.loop !12

_FortranASumInteger4x1_contract_simplified.exit:  ; preds = %.lr.ph.i, %middle.block, %0
  %.lcssa.i = phi i32 [ 0, %0 ], [ %25, %middle.block ], [ %31, %.lr.ph.i ]
  %33 = load i32, ptr %5, align 4, !tbaa !3
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %_FortranASumInteger4x1_contract_simplified.exit
  %35 = zext i32 %33 to i64
  %_QFEcnt.promoted = load i32, ptr @_QFEcnt, align 4, !tbaa !3
  %36 = load i32, ptr %4, align 4, !tbaa !3
  %xtraiter = and i64 %35, 1
  %37 = icmp eq i32 %33, 1
  br i1 %37, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %35, 4294967294
  br label %38

38:                                               ; preds = %55, %.lr.ph.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next.1, %55 ]
  %39 = phi i32 [ %_QFEcnt.promoted, %.lr.ph.new ], [ %56, %55 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %55 ]
  %40 = add nsw i64 %indvars.iv, -1
  %41 = getelementptr i32, ptr %.unpack245, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !3
  %43 = shl i32 %42, 2
  %44 = mul i32 %43, %36
  %.not269 = icmp slt i32 %44, %.lcssa.i
  br i1 %.not269, label %47, label %45

45:                                               ; preds = %38
  %46 = add i32 %39, 1
  store i32 %46, ptr @_QFEcnt, align 4, !tbaa !3
  br label %47

47:                                               ; preds = %45, %38
  %48 = phi i32 [ %46, %45 ], [ %39, %38 ]
  %49 = getelementptr i32, ptr %.unpack245, i64 %indvars.iv
  %50 = load i32, ptr %49, align 4, !tbaa !3
  %51 = shl i32 %50, 2
  %52 = mul i32 %51, %36
  %.not269.1 = icmp slt i32 %52, %.lcssa.i
  br i1 %.not269.1, label %55, label %53

53:                                               ; preds = %47
  %54 = add i32 %48, 1
  store i32 %54, ptr @_QFEcnt, align 4, !tbaa !3
  br label %55

55:                                               ; preds = %53, %47
  %56 = phi i32 [ %54, %53 ], [ %48, %47 ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 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 %38

._crit_edge.loopexit.unr-lcssa.loopexit:          ; preds = %55
  %57 = add nuw nsw i64 %indvars.iv, 1
  br label %._crit_edge.loopexit.unr-lcssa

._crit_edge.loopexit.unr-lcssa:                   ; preds = %._crit_edge.loopexit.unr-lcssa.loopexit, %.lr.ph
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %57, %._crit_edge.loopexit.unr-lcssa.loopexit ]
  %.unr = phi i32 [ %_QFEcnt.promoted, %.lr.ph ], [ %56, %._crit_edge.loopexit.unr-lcssa.loopexit ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa
  %58 = getelementptr i32, ptr %.unpack245, i64 %indvars.iv.unr
  %59 = load i32, ptr %58, align 4, !tbaa !3
  %60 = shl i32 %59, 2
  %61 = mul i32 %60, %36
  %.not269.epil = icmp slt i32 %61, %.lcssa.i
  br i1 %.not269.epil, label %._crit_edge, label %62

62:                                               ; preds = %.epil.preheader
  %63 = add i32 %.unr, 1
  store i32 %63, ptr @_QFEcnt, align 4, !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %62, %.epil.preheader, %_FortranASumInteger4x1_contract_simplified.exit
  %64 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.284129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.3d074a16c45063b17f842d241e87bcf7, i32 14)
  %65 = load i32, ptr @_QFEcnt, align 4, !tbaa !3
  %66 = load i32, ptr %4, align 4, !tbaa !3
  %.not = icmp slt i32 %65, %66
  %67 = select i1 %.not, ptr @_QQcl.4E6F20, ptr @_QQcl.596573
  store ptr %67, ptr %1, align 8, !tbaa !7
  %.fca.1.gep142 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  store i64 3, ptr %.fca.1.gep142, align 8, !tbaa !7
  %.fca.2.gep144 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep144, align 8, !tbaa !7
  %.fca.3.gep146 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep146, align 4, !tbaa !7
  %.fca.4.gep148 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep148, align 1, !tbaa !7
  %.fca.5.gep150 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep150, align 2, !tbaa !7
  %.fca.6.gep152 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep152, align 1, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %3, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %68 = call {} @_FortranATrim(ptr nonnull %3, ptr nonnull %1, ptr nonnull @_QQcl.3d074a16c45063b17f842d241e87bcf7, i32 14)
  %.fca.0.load = load ptr, ptr %3, align 8, !tbaa !7
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8, !tbaa !7
  %69 = call i1 @_FortranAioOutputAscii(ptr %64, ptr %.fca.0.load, i64 %.fca.1.load)
  call void @free(ptr %.fca.0.load)
  %70 = call i32 @_FortranAioEndIoStatement(ptr %64)
  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

declare {} @_FortranATrim(ptr, ptr, ptr, i32) local_unnamed_addr

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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}
