program BegB
  implicit none
  integer :: H, N, k
  integer(8),allocatable,dimension(:) :: A
  read(*,*) H, N
  allocate(A(N))

  read(*,*) (A(k) ,k=1,N)
  if(sum(A).ge.H) then
     print*, 'Yes'
  else
     print*, 'No'
  end if


end program BegB
; 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.f2c13137ecba79d935092ae01a17e770 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_2500/source.f\00"
@_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 i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.f2c13137ecba79d935092ae01a17e770, i32 5)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 4)
  %5 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %7 = load i32, ptr %2, align 4, !tbaa !3
  %8 = call i32 @llvm.smax.i32(i32 %7, i32 0)
  %9 = zext i32 %8 to i64
  %10 = shl nuw nsw 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.f2c13137ecba79d935092ae01a17e770, i32 8)
  %13 = load i32, ptr %2, align 4, !tbaa !3
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %15 = zext i32 %13 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %16 = phi i64 [ %21, %.lr.ph ], [ 1, %.lr.ph.preheader ]
  %.unpack88 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %sext = shl i64 %16, 32
  %17 = ashr exact i64 %sext, 32
  %18 = add nsw i64 %17, -1
  %19 = getelementptr i64, ptr %.unpack88, i64 %18
  %20 = call i1 @_FortranAioInputInteger(ptr %12, ptr %19, i32 8)
  %21 = add nuw nsw i64 %16, 1
  %exitcond.not = icmp eq i64 %16, %15
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %22 = call i32 @_FortranAioEndIoStatement(ptr %12)
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack83.unpack.unpack85 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  %23 = icmp sgt i64 %.unpack83.unpack.unpack85, 0
  br i1 %23, label %.lr.ph.i.preheader, label %_FortranASumInteger8x1_contract_simplified.exit

.lr.ph.i.preheader:                               ; preds = %._crit_edge
  %min.iters.check = icmp ult i64 %.unpack83.unpack.unpack85, 4
  br i1 %min.iters.check, label %.lr.ph.i.preheader102, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.i.preheader
  %n.vec = and i64 %.unpack83.unpack.unpack85, -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 ], [ %27, %vector.body ]
  %vec.phi100 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %28, %vector.body ]
  %24 = shl i64 %index, 3
  %25 = getelementptr i8, ptr %.unpack, i64 %24
  %wide.load = load <2 x i64>, ptr %25, align 8, !tbaa !3
  %26 = getelementptr i64, ptr %25, i64 2
  %wide.load101 = load <2 x i64>, ptr %26, align 8, !tbaa !3
  %27 = add <2 x i64> %wide.load, %vec.phi
  %28 = add <2 x i64> %wide.load101, %vec.phi100
  %index.next = add nuw i64 %index, 4
  %29 = icmp eq i64 %index.next, %n.vec
  br i1 %29, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %28, %27
  %30 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %.unpack83.unpack.unpack85, %n.vec
  br i1 %cmp.n, label %_FortranASumInteger8x1_contract_simplified.exit, label %.lr.ph.i.preheader102

.lr.ph.i.preheader102:                            ; preds = %.lr.ph.i.preheader, %middle.block
  %.ph = phi i64 [ 0, %.lr.ph.i.preheader ], [ %30, %middle.block ]
  %.ph103 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.lr.ph.i.preheader102, %.lr.ph.i
  %31 = phi i64 [ %36, %.lr.ph.i ], [ %.ph, %.lr.ph.i.preheader102 ]
  %32 = phi i64 [ %37, %.lr.ph.i ], [ %.ph103, %.lr.ph.i.preheader102 ]
  %33 = shl i64 %32, 3
  %34 = getelementptr i8, ptr %.unpack, i64 %33
  %35 = load i64, ptr %34, align 8, !tbaa !3
  %36 = add i64 %35, %31
  %37 = add nuw nsw i64 %32, 1
  %exitcond.not.i = icmp eq i64 %37, %.unpack83.unpack.unpack85
  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, %._crit_edge
  %.lcssa.i = phi i64 [ 0, %._crit_edge ], [ %30, %middle.block ], [ %36, %.lr.ph.i ]
  %38 = load i32, ptr %1, align 4, !tbaa !3
  %39 = sext i32 %38 to i64
  %.not = icmp slt i64 %.lcssa.i, %39
  br i1 %.not, label %43, label %40

40:                                               ; preds = %_FortranASumInteger8x1_contract_simplified.exit
  %41 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.f2c13137ecba79d935092ae01a17e770, i32 10)
  %42 = call i1 @_FortranAioOutputAscii(ptr %41, ptr nonnull @_QQcl.596573, i64 3)
  br label %46

43:                                               ; preds = %_FortranASumInteger8x1_contract_simplified.exit
  %44 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.f2c13137ecba79d935092ae01a17e770, i32 12)
  %45 = call i1 @_FortranAioOutputAscii(ptr %44, ptr nonnull @_QQcl.4E6F, i64 2)
  br label %46

46:                                               ; preds = %40, %43
  %.sink = phi ptr [ %41, %40 ], [ %44, %43 ]
  %47 = 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 ptr @_FortranAioBeginExternalListOutput(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 i32 @llvm.smax.i32(i32, i32) #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}
