program main
  implicit none
  
  integer :: n,i,j,a(10) = 0,t,s=0
  
  read(*,*)n
  read(*,*)(a(i), i = 1, n)
  do i=1,N-1
     do j=i+1,N
        if(a(i) .gt. a(j))then
           t=a(i)
           a(i)=a(j)
           a(j)=t
        end if
     end do
  end do
  
  do i = 1, n-1
    s = s + a(i)
  end do
  
  if (a(n) < s) then
    write(*,*)'Yes'
  else
    write(*,*)'No'
  end if
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 = internal global [10 x i32] zeroinitializer
@_QFEs = internal unnamed_addr global i32 0
@_QQcl.ac2db87a3e58aba5b721444ef1d14520 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5009/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

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ac2db87a3e58aba5b721444ef1d14520, i32 6)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 4)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ac2db87a3e58aba5b721444ef1d14520, i32 7)
  %6 = load i32, ptr %1, align 4, !tbaa !3
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph.preheader, label %._crit_edge

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %9 = phi i64 [ %14, %.lr.ph ], [ 1, %.lr.ph.preheader ]
  %sext = shl i64 %9, 32
  %10 = ashr exact i64 %sext, 32
  %11 = add nsw i64 %10, -1
  %12 = getelementptr [10 x i32], ptr @_QFEa, i64 0, i64 %11
  %13 = call i1 @_FortranAioInputInteger(ptr %5, ptr %12, i32 4)
  %14 = add nuw nsw i64 %9, 1
  %exitcond.not = icmp eq i64 %9, %8
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %15 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %16 = load i32, ptr %1, align 4, !tbaa !3
  %17 = add i32 %16, -1
  %18 = sext i32 %17 to i64
  %19 = icmp sgt i32 %17, 0
  br i1 %19, label %.lr.ph22, label %.preheader.thread

.preheader.thread:                                ; preds = %._crit_edge
  %_QFEs.promoted32 = load i32, ptr @_QFEs, align 4, !tbaa !3
  br label %55

.lr.ph22:                                         ; preds = %._crit_edge
  %20 = sext i32 %16 to i64
  %21 = add nsw i64 %20, 1
  br label %29

.preheader:                                       ; preds = %._crit_edge20
  %_QFEs.promoted = load i32, ptr @_QFEs, align 4, !tbaa !3
  br i1 %19, label %.lr.ph23.preheader, label %55

.lr.ph23.preheader:                               ; preds = %.preheader
  %min.iters.check = icmp ult i32 %17, 8
  br i1 %min.iters.check, label %.lr.ph23.preheader35, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph23.preheader
  %n.vec = and i64 %18, -8
  %ind.end = or i64 %n.vec, 1
  %22 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %_QFEs.promoted, i64 0
  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> [ %22, %vector.ph ], [ %25, %vector.body ]
  %vec.phi33 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %26, %vector.body ]
  %23 = getelementptr [10 x i32], ptr @_QFEa, i64 0, i64 %index
  %wide.load = load <4 x i32>, ptr %23, align 16, !tbaa !3
  %24 = getelementptr i32, ptr %23, i64 4
  %wide.load34 = load <4 x i32>, ptr %24, align 16, !tbaa !3
  %25 = add <4 x i32> %wide.load, %vec.phi
  %26 = add <4 x i32> %wide.load34, %vec.phi33
  %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 !7

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %26, %25
  %28 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %18
  br i1 %cmp.n, label %._crit_edge24, label %.lr.ph23.preheader35

.lr.ph23.preheader35:                             ; preds = %.lr.ph23.preheader, %middle.block
  %indvars.iv27.ph = phi i64 [ 1, %.lr.ph23.preheader ], [ %ind.end, %middle.block ]
  %.ph = phi i32 [ %_QFEs.promoted, %.lr.ph23.preheader ], [ %28, %middle.block ]
  br label %.lr.ph23

29:                                               ; preds = %.lr.ph22, %._crit_edge20
  %indvars.iv = phi i64 [ 1, %.lr.ph22 ], [ %indvars.iv.next, %._crit_edge20 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %sext31 = shl i64 %indvars.iv.next, 32
  %30 = ashr exact i64 %sext31, 32
  %31 = sub nsw i64 %21, %30
  %32 = icmp sgt i64 %31, 0
  br i1 %32, label %.lr.ph19, label %._crit_edge20

.lr.ph19:                                         ; preds = %29
  %33 = trunc i64 %indvars.iv.next to i32
  %34 = add nsw i64 %indvars.iv, -1
  %35 = getelementptr [10 x i32], ptr @_QFEa, i64 0, i64 %34
  br label %36

36:                                               ; preds = %.lr.ph19, %46
  %37 = phi i64 [ %31, %.lr.ph19 ], [ %48, %46 ]
  %38 = phi i32 [ %33, %.lr.ph19 ], [ %47, %46 ]
  %39 = load i32, ptr %35, align 4, !tbaa !3
  %40 = sext i32 %38 to i64
  %41 = add nsw i64 %40, -1
  %42 = getelementptr [10 x i32], ptr @_QFEa, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !3
  %44 = icmp sgt i32 %39, %43
  br i1 %44, label %45, label %46

45:                                               ; preds = %36
  store i32 %43, ptr %35, align 4, !tbaa !3
  store i32 %39, ptr %42, align 4, !tbaa !3
  br label %46

46:                                               ; preds = %45, %36
  %47 = add i32 %38, 1
  %48 = add nsw i64 %37, -1
  %49 = icmp sgt i64 %37, 1
  br i1 %49, label %36, label %._crit_edge20

._crit_edge20:                                    ; preds = %46, %29
  %exitcond26.not = icmp eq i64 %indvars.iv, %18
  br i1 %exitcond26.not, label %.preheader, label %29

.lr.ph23:                                         ; preds = %.lr.ph23.preheader35, %.lr.ph23
  %indvars.iv27 = phi i64 [ %indvars.iv.next28, %.lr.ph23 ], [ %indvars.iv27.ph, %.lr.ph23.preheader35 ]
  %50 = phi i32 [ %54, %.lr.ph23 ], [ %.ph, %.lr.ph23.preheader35 ]
  %51 = add nsw i64 %indvars.iv27, -1
  %52 = getelementptr [10 x i32], ptr @_QFEa, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !3
  %54 = add i32 %53, %50
  %indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1
  %exitcond30.not = icmp eq i64 %indvars.iv27, %18
  br i1 %exitcond30.not, label %._crit_edge24, label %.lr.ph23, !llvm.loop !10

._crit_edge24:                                    ; preds = %.lr.ph23, %middle.block
  %.lcssa = phi i32 [ %28, %middle.block ], [ %54, %.lr.ph23 ]
  store i32 %.lcssa, ptr @_QFEs, align 4, !tbaa !3
  br label %55

55:                                               ; preds = %.preheader.thread, %._crit_edge24, %.preheader
  %56 = phi i32 [ %.lcssa, %._crit_edge24 ], [ %_QFEs.promoted, %.preheader ], [ %_QFEs.promoted32, %.preheader.thread ]
  %57 = sext i32 %16 to i64
  %58 = add nsw i64 %57, -1
  %59 = getelementptr [10 x i32], ptr @_QFEa, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !3
  %61 = icmp slt i32 %60, %56
  br i1 %61, label %62, label %65

62:                                               ; preds = %55
  %63 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.ac2db87a3e58aba5b721444ef1d14520, i32 23)
  %64 = call i1 @_FortranAioOutputAscii(ptr %63, ptr nonnull @_QQcl.596573, i64 3)
  br label %68

65:                                               ; preds = %55
  %66 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.ac2db87a3e58aba5b721444ef1d14520, i32 25)
  %67 = call i1 @_FortranAioOutputAscii(ptr %66, ptr nonnull @_QQcl.4E6F, i64 2)
  br label %68

68:                                               ; preds = %62, %65
  %.sink = phi ptr [ %63, %62 ], [ %66, %65 ]
  %69 = 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 willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #0

attributes #0 = { 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 = distinct !{!7, !8, !9}
!8 = !{!"llvm.loop.isvectorized", i32 1}
!9 = !{!"llvm.loop.unroll.runtime.disable"}
!10 = distinct !{!10, !9, !8}
