program main
   implicit none
   integer i,h,n
   integer,allocatable :: a(:)
   
   read(*,*) h,n
   allocate(a(n))
   read(*,*) (a(i),i=1,n)
   if(sum(a)>=h) then
      write(*,'(a)') 'Yes'
   else
      write(*,'(a)') 'No'
   endif
end program main


; 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.ac9bd0224f2949877f96e9cf1b16e3c8 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_2501/source.f\00"
@_QQcl.286129 = 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 i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ac9bd0224f2949877f96e9cf1b16e3c8, i32 6)
  %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, 2
  %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.ac9bd0224f2949877f96e9cf1b16e3c8, 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 i32, ptr %.unpack88, i64 %18
  %20 = call i1 @_FortranAioInputInteger(ptr %12, ptr %19, i32 4)
  %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 %_FortranASumInteger4x1_contract_simplified.exit

.lr.ph.i.preheader:                               ; preds = %._crit_edge
  %min.iters.check = icmp ult i64 %.unpack83.unpack.unpack85, 8
  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, -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 ], [ %27, %vector.body ]
  %vec.phi100 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %28, %vector.body ]
  %24 = shl i64 %index, 2
  %25 = getelementptr i8, ptr %.unpack, i64 %24
  %wide.load = load <4 x i32>, ptr %25, align 4, !tbaa !3
  %26 = getelementptr i32, ptr %25, i64 4
  %wide.load101 = load <4 x i32>, ptr %26, align 4, !tbaa !3
  %27 = add <4 x i32> %wide.load, %vec.phi
  %28 = add <4 x i32> %wide.load101, %vec.phi100
  %index.next = add nuw i64 %index, 8
  %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 <4 x i32> %28, %27
  %30 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %.unpack83.unpack.unpack85, %n.vec
  br i1 %cmp.n, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i.preheader102

.lr.ph.i.preheader102:                            ; preds = %.lr.ph.i.preheader, %middle.block
  %.ph = phi i32 [ 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 i32 [ %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, 2
  %34 = getelementptr i8, ptr %.unpack, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !3
  %36 = add i32 %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 %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i, !llvm.loop !12

_FortranASumInteger4x1_contract_simplified.exit:  ; preds = %.lr.ph.i, %middle.block, %._crit_edge
  %.lcssa.i = phi i32 [ 0, %._crit_edge ], [ %30, %middle.block ], [ %36, %.lr.ph.i ]
  %38 = load i32, ptr %1, align 4, !tbaa !3
  %.not = icmp slt i32 %.lcssa.i, %38
  br i1 %.not, label %42, label %39

39:                                               ; preds = %_FortranASumInteger4x1_contract_simplified.exit
  %40 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.ac9bd0224f2949877f96e9cf1b16e3c8, i32 10)
  %41 = call i1 @_FortranAioOutputAscii(ptr %40, ptr nonnull @_QQcl.596573, i64 3)
  br label %45

42:                                               ; preds = %_FortranASumInteger4x1_contract_simplified.exit
  %43 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.ac9bd0224f2949877f96e9cf1b16e3c8, i32 12)
  %44 = call i1 @_FortranAioOutputAscii(ptr %43, ptr nonnull @_QQcl.4E6F, i64 2)
  br label %45

45:                                               ; preds = %39, %42
  %.sink = phi ptr [ %40, %39 ], [ %43, %42 ]
  %46 = 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 @_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 i32 @llvm.smax.i32(i32, i32) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #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}
