program main
 implicit none
 integer*8 N,i,flag
 integer*8, allocatable::H(:)
 read(*,*) N
 allocate(H(1:N))
 read(*,*) H
 
 flag = 0
 do i=N,2,-1
  if(H(i-1) - H(i) > 1) then
   flag = 1
   exit
  else if(H(i-1) - H(i) == 1) then
   H(i-1) = H(i-1) - 1
  end if
 end do
 
 if(flag == 0) 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"

@_QFEh.0 = internal unnamed_addr global ptr null
@_QFEh.8 = internal unnamed_addr global i64 0
@_QQcl.50923bd1bd4f8b91a3a2546e1d4435f9 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3599/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 { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca i64, align 8
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.50923bd1bd4f8b91a3a2546e1d4435f9, i32 5)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 8)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = load i64, ptr %2, align 8, !tbaa !3
  %7 = call i64 @llvm.smax.i64(i64 %6, i64 0)
  %8 = shl i64 %7, 3
  %9 = call ptr @malloc(i64 %8)
  store ptr %9, ptr @_QFEh.0, align 8, !tbaa !7
  store i64 %7, ptr @_QFEh.8, align 8, !tbaa !7
  %10 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.50923bd1bd4f8b91a3a2546e1d4435f9, i32 7)
  %.unpack = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  %.unpack152.unpack.unpack154 = load i64, ptr @_QFEh.8, align 8, !tbaa !7
  store ptr %.unpack, ptr %1, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 8, ptr %.fca.1.gep, align 8, !tbaa !7
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 10, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, 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 %1, i64 0, i32 7, i64 0, i64 1
  store i64 %.unpack152.unpack.unpack154, 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 %1, i64 0, i32 7, i64 0, i64 2
  store i64 8, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %11 = call i1 @_FortranAioInputDescriptor(ptr %10, ptr nonnull %1)
  %12 = call i32 @_FortranAioEndIoStatement(ptr %10)
  %13 = load i64, ptr %2, align 8, !tbaa !3
  %.0135169 = add i64 %13, -1
  %14 = icmp slt i64 %.0135169, 1
  br i1 %14, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %.unpack157 = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  br label %15

15:                                               ; preds = %.lr.ph, %28
  %.0135171 = phi i64 [ %.0135169, %.lr.ph ], [ %.0135, %28 ]
  %.0170 = phi i64 [ %13, %.lr.ph ], [ %29, %28 ]
  %16 = add i64 %.0170, -2
  %17 = getelementptr i64, ptr %.unpack157, i64 %16
  %18 = load i64, ptr %17, align 8, !tbaa !3
  %19 = add i64 %.0170, -1
  %20 = getelementptr i64, ptr %.unpack157, i64 %19
  %21 = load i64, ptr %20, align 8, !tbaa !3
  %22 = sub i64 %18, %21
  %23 = icmp sgt i64 %22, 1
  br i1 %23, label %33, label %24

24:                                               ; preds = %15
  %25 = icmp eq i64 %22, 1
  br i1 %25, label %26, label %28

26:                                               ; preds = %24
  %27 = add i64 %18, -1
  store i64 %27, ptr %17, align 8, !tbaa !3
  br label %28

28:                                               ; preds = %26, %24
  %29 = add i64 %.0170, -1
  %.0135 = add i64 %.0135171, -1
  %30 = icmp slt i64 %.0135, 1
  br i1 %30, label %.critedge, label %15

.critedge:                                        ; preds = %28, %0
  %31 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.50923bd1bd4f8b91a3a2546e1d4435f9, i32 20)
  %32 = call i1 @_FortranAioOutputAscii(ptr %31, ptr nonnull @_QQcl.596573, i64 3)
  br label %36

33:                                               ; preds = %15
  %34 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.50923bd1bd4f8b91a3a2546e1d4435f9, i32 22)
  %35 = call i1 @_FortranAioOutputAscii(ptr %34, ptr nonnull @_QQcl.4E6F, i64 2)
  br label %36

36:                                               ; preds = %.critedge, %33
  %.sink = phi ptr [ %31, %.critedge ], [ %34, %33 ]
  %37 = 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 i1 @_FortranAioInputDescriptor(ptr, 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 i64 @llvm.smax.i64(i64, i64) #1

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) }

!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}
