PROGRAM ATCODER

implicit none
integer :: n, i
integer,allocatable :: l(:)

read(*,*) n
allocate(l(n))

read(*,*) (l(i),i=1,n)

if ( maxval(l) < sum(l)-maxval(l) ) then
	write(*,'(a)') 'Yes'
else
	write(*,'(a)') 'No'
end if

END PROGRAM ATCODER
; 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"

@_QFEl.0 = internal unnamed_addr global ptr null
@_QFEl.8 = internal unnamed_addr global i64 0
@_QQcl.e98b33f85d6f5d623dd40e8d4ad81147 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5005/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 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.e98b33f85d6f5d623dd40e8d4ad81147, i32 7)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 4)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i32, ptr %1, align 4, !tbaa !3
  %6 = call i32 @llvm.smax.i32(i32 %5, i32 0)
  %7 = zext i32 %6 to i64
  %8 = shl nuw nsw i64 %7, 2
  %9 = call ptr @malloc(i64 %8)
  store ptr %9, ptr @_QFEl.0, align 8, !tbaa !7
  store i64 %7, ptr @_QFEl.8, align 8, !tbaa !7
  %10 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.e98b33f85d6f5d623dd40e8d4ad81147, i32 10)
  %11 = load i32, ptr %1, align 4, !tbaa !3
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph.preheader, label %._crit_edge

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

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

._crit_edge:                                      ; preds = %.lr.ph, %0
  %20 = call i32 @_FortranAioEndIoStatement(ptr %10)
  %.unpack = load ptr, ptr @_QFEl.0, align 8, !tbaa !7
  %.unpack183.unpack.unpack185 = load i64, ptr @_QFEl.8, align 8, !tbaa !7
  %21 = icmp sgt i64 %.unpack183.unpack.unpack185, 0
  br i1 %21, label %.lr.ph.i.preheader, label %_FortranAMaxvalInteger4x1_contract_simplified.exit230.thread

.lr.ph.i.preheader:                               ; preds = %._crit_edge
  %min.iters.check = icmp ult i64 %.unpack183.unpack.unpack185, 8
  br i1 %min.iters.check, label %.lr.ph.i.preheader313, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.i.preheader
  %n.vec = and i64 %.unpack183.unpack.unpack185, -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> [ <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648>, %vector.ph ], [ %25, %vector.body ]
  %vec.phi266 = phi <4 x i32> [ <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648>, %vector.ph ], [ %26, %vector.body ]
  %22 = shl i64 %index, 2
  %23 = getelementptr i8, ptr %.unpack, i64 %22
  %wide.load = load <4 x i32>, ptr %23, align 4, !tbaa !3
  %24 = getelementptr i32, ptr %23, i64 4
  %wide.load267 = load <4 x i32>, ptr %24, align 4, !tbaa !3
  %25 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
  %26 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load267, <4 x i32> %vec.phi266)
  %index.next = add nuw i64 %index, 8
  %27 = icmp eq i64 %index.next, %n.vec
  br i1 %27, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %rdx.minmax.select = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %25, <4 x i32> %26)
  %28 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax.select)
  %cmp.n = icmp eq i64 %.unpack183.unpack.unpack185, %n.vec
  br i1 %cmp.n, label %.lr.ph.i224.preheader, label %.lr.ph.i.preheader313

.lr.ph.i.preheader313:                            ; preds = %.lr.ph.i.preheader, %middle.block
  %.ph314 = phi i32 [ -2147483648, %.lr.ph.i.preheader ], [ %28, %middle.block ]
  %.ph315 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.lr.ph.i.preheader313, %.lr.ph.i
  %29 = phi i32 [ %34, %.lr.ph.i ], [ %.ph314, %.lr.ph.i.preheader313 ]
  %30 = phi i64 [ %35, %.lr.ph.i ], [ %.ph315, %.lr.ph.i.preheader313 ]
  %31 = shl i64 %30, 2
  %32 = getelementptr i8, ptr %.unpack, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !3
  %34 = call i32 @llvm.smax.i32(i32 %33, i32 %29)
  %35 = add nuw nsw i64 %30, 1
  %exitcond.not.i = icmp eq i64 %35, %.unpack183.unpack.unpack185
  br i1 %exitcond.not.i, label %.lr.ph.i224.preheader, label %.lr.ph.i, !llvm.loop !12

.lr.ph.i224.preheader:                            ; preds = %.lr.ph.i, %middle.block
  %.lcssa265 = phi i32 [ %28, %middle.block ], [ %34, %.lr.ph.i ]
  %min.iters.check270 = icmp ult i64 %.unpack183.unpack.unpack185, 8
  br i1 %min.iters.check270, label %.lr.ph.i224.preheader307, label %vector.ph271

vector.ph271:                                     ; preds = %.lr.ph.i224.preheader
  %n.vec273 = and i64 %.unpack183.unpack.unpack185, -8
  br label %vector.body276

vector.body276:                                   ; preds = %vector.body276, %vector.ph271
  %index277 = phi i64 [ 0, %vector.ph271 ], [ %index.next282, %vector.body276 ]
  %vec.phi278 = phi <4 x i32> [ zeroinitializer, %vector.ph271 ], [ %39, %vector.body276 ]
  %vec.phi279 = phi <4 x i32> [ zeroinitializer, %vector.ph271 ], [ %40, %vector.body276 ]
  %36 = shl i64 %index277, 2
  %37 = getelementptr i8, ptr %.unpack, i64 %36
  %wide.load280 = load <4 x i32>, ptr %37, align 4, !tbaa !3
  %38 = getelementptr i32, ptr %37, i64 4
  %wide.load281 = load <4 x i32>, ptr %38, align 4, !tbaa !3
  %39 = add <4 x i32> %wide.load280, %vec.phi278
  %40 = add <4 x i32> %wide.load281, %vec.phi279
  %index.next282 = add nuw i64 %index277, 8
  %41 = icmp eq i64 %index.next282, %n.vec273
  br i1 %41, label %middle.block268, label %vector.body276, !llvm.loop !13

middle.block268:                                  ; preds = %vector.body276
  %bin.rdx = add <4 x i32> %40, %39
  %42 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n275 = icmp eq i64 %.unpack183.unpack.unpack185, %n.vec273
  br i1 %cmp.n275, label %.lr.ph.i227.preheader, label %.lr.ph.i224.preheader307

.lr.ph.i224.preheader307:                         ; preds = %.lr.ph.i224.preheader, %middle.block268
  %.ph308 = phi i32 [ 0, %.lr.ph.i224.preheader ], [ %42, %middle.block268 ]
  %.ph309 = phi i64 [ 0, %.lr.ph.i224.preheader ], [ %n.vec273, %middle.block268 ]
  br label %.lr.ph.i224

.lr.ph.i224:                                      ; preds = %.lr.ph.i224.preheader307, %.lr.ph.i224
  %43 = phi i32 [ %48, %.lr.ph.i224 ], [ %.ph308, %.lr.ph.i224.preheader307 ]
  %44 = phi i64 [ %49, %.lr.ph.i224 ], [ %.ph309, %.lr.ph.i224.preheader307 ]
  %45 = shl i64 %44, 2
  %46 = getelementptr i8, ptr %.unpack, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !3
  %48 = add i32 %47, %43
  %49 = add nuw nsw i64 %44, 1
  %exitcond.not.i225 = icmp eq i64 %49, %.unpack183.unpack.unpack185
  br i1 %exitcond.not.i225, label %.lr.ph.i227.preheader, label %.lr.ph.i224, !llvm.loop !14

.lr.ph.i227.preheader:                            ; preds = %.lr.ph.i224, %middle.block268
  %.lcssa264 = phi i32 [ %42, %middle.block268 ], [ %48, %.lr.ph.i224 ]
  %min.iters.check286 = icmp ult i64 %.unpack183.unpack.unpack185, 8
  br i1 %min.iters.check286, label %.lr.ph.i227.preheader302, label %vector.ph287

vector.ph287:                                     ; preds = %.lr.ph.i227.preheader
  %n.vec289 = and i64 %.unpack183.unpack.unpack185, -8
  br label %vector.body292

vector.body292:                                   ; preds = %vector.body292, %vector.ph287
  %index293 = phi i64 [ 0, %vector.ph287 ], [ %index.next298, %vector.body292 ]
  %vec.phi294 = phi <4 x i32> [ <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648>, %vector.ph287 ], [ %53, %vector.body292 ]
  %vec.phi295 = phi <4 x i32> [ <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648>, %vector.ph287 ], [ %54, %vector.body292 ]
  %50 = shl i64 %index293, 2
  %51 = getelementptr i8, ptr %.unpack, i64 %50
  %wide.load296 = load <4 x i32>, ptr %51, align 4, !tbaa !3
  %52 = getelementptr i32, ptr %51, i64 4
  %wide.load297 = load <4 x i32>, ptr %52, align 4, !tbaa !3
  %53 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load296, <4 x i32> %vec.phi294)
  %54 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load297, <4 x i32> %vec.phi295)
  %index.next298 = add nuw i64 %index293, 8
  %55 = icmp eq i64 %index.next298, %n.vec289
  br i1 %55, label %middle.block284, label %vector.body292, !llvm.loop !15

middle.block284:                                  ; preds = %vector.body292
  %rdx.minmax.select300 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %53, <4 x i32> %54)
  %56 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax.select300)
  %cmp.n291 = icmp eq i64 %.unpack183.unpack.unpack185, %n.vec289
  br i1 %cmp.n291, label %_FortranAMaxvalInteger4x1_contract_simplified.exit230, label %.lr.ph.i227.preheader302

.lr.ph.i227.preheader302:                         ; preds = %.lr.ph.i227.preheader, %middle.block284
  %.ph = phi i32 [ -2147483648, %.lr.ph.i227.preheader ], [ %56, %middle.block284 ]
  %.ph303 = phi i64 [ 0, %.lr.ph.i227.preheader ], [ %n.vec289, %middle.block284 ]
  br label %.lr.ph.i227

.lr.ph.i227:                                      ; preds = %.lr.ph.i227.preheader302, %.lr.ph.i227
  %57 = phi i32 [ %62, %.lr.ph.i227 ], [ %.ph, %.lr.ph.i227.preheader302 ]
  %58 = phi i64 [ %63, %.lr.ph.i227 ], [ %.ph303, %.lr.ph.i227.preheader302 ]
  %59 = shl i64 %58, 2
  %60 = getelementptr i8, ptr %.unpack, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !3
  %62 = call i32 @llvm.smax.i32(i32 %61, i32 %57)
  %63 = add nuw nsw i64 %58, 1
  %exitcond.not.i228 = icmp eq i64 %63, %.unpack183.unpack.unpack185
  br i1 %exitcond.not.i228, label %_FortranAMaxvalInteger4x1_contract_simplified.exit230, label %.lr.ph.i227, !llvm.loop !16

_FortranAMaxvalInteger4x1_contract_simplified.exit230: ; preds = %.lr.ph.i227, %middle.block284
  %.lcssa = phi i32 [ %56, %middle.block284 ], [ %62, %.lr.ph.i227 ]
  %64 = sub i32 %.lcssa264, %.lcssa
  %65 = icmp slt i32 %.lcssa265, %64
  br i1 %65, label %66, label %_FortranAMaxvalInteger4x1_contract_simplified.exit230.thread

66:                                               ; preds = %_FortranAMaxvalInteger4x1_contract_simplified.exit230
  %67 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.e98b33f85d6f5d623dd40e8d4ad81147, i32 13)
  %68 = call i1 @_FortranAioOutputAscii(ptr %67, ptr nonnull @_QQcl.596573, i64 3)
  br label %71

_FortranAMaxvalInteger4x1_contract_simplified.exit230.thread: ; preds = %._crit_edge, %_FortranAMaxvalInteger4x1_contract_simplified.exit230
  %69 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.e98b33f85d6f5d623dd40e8d4ad81147, i32 15)
  %70 = call i1 @_FortranAioOutputAscii(ptr %69, ptr nonnull @_QQcl.4E6F, i64 2)
  br label %71

71:                                               ; preds = %66, %_FortranAMaxvalInteger4x1_contract_simplified.exit230.thread
  %.sink = phi ptr [ %67, %66 ], [ %69, %_FortranAMaxvalInteger4x1_contract_simplified.exit230.thread ]
  %72 = 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #1

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

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

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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}
!13 = distinct !{!13, !10, !11}
!14 = distinct !{!14, !11, !10}
!15 = distinct !{!15, !10, !11}
!16 = distinct !{!16, !11, !10}
