      PROGRAM buildStairs
      IMPLICIT NONE
      integer(16) :: n
      integer(16),allocatable :: h(:)
      integer(16) :: i
      
      
      read*,n
      allocate( h(n) )
      read*,h(1:n)
      
      do i = n,2,-1
        if( h(i-1)-1>h(i) )then
          print*,'No';stop
        else if( h(i-1)-1==h(i) )then
          h(i-1) = h(i-1) - 1
        end if
      end do
      
      print*,'Yes'
      
      
      
      
      
      
      
      END PROGRAM
; 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
@_QQcl.a9352283a1c8461d59311b47ec60a0e9 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3604/source.f\00"
@_QQcl.4E6F = linkonce constant [2 x i8] c"No"
@_QQcl.596573 = linkonce constant [3 x i8] c"Yes"
@_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 i128, align 8
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.a9352283a1c8461d59311b47ec60a0e9, i32 8)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 16)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = load i128, ptr %2, align 8, !tbaa !3
  %7 = trunc i128 %6 to i64
  %8 = call i64 @llvm.smax.i64(i64 %7, i64 0)
  %9 = shl i64 %8, 4
  %10 = call ptr @malloc(i64 %9)
  store ptr %10, ptr @_QFEh.0, align 8, !tbaa !7
  %11 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.a9352283a1c8461d59311b47ec60a0e9, i32 10)
  %.unpack = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  %12 = load i128, ptr %2, align 8, !tbaa !3
  %13 = trunc i128 %12 to i64
  %14 = call i64 @llvm.smax.i64(i64 %13, i64 0)
  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 16, 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 11, 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 %14, 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 16, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %15 = call i1 @_FortranAioInputDescriptor(ptr %11, ptr nonnull %1)
  %16 = call i32 @_FortranAioEndIoStatement(ptr %11)
  %17 = load i128, ptr %2, align 8, !tbaa !3
  %.0133168 = add i128 %17, -1
  %18 = icmp sgt i128 %.0133168, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

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

19:                                               ; preds = %.lr.ph, %37
  %.0133170 = phi i128 [ %.0133168, %.lr.ph ], [ %.0133, %37 ]
  %.0169 = phi i128 [ %17, %.lr.ph ], [ %38, %37 ]
  %20 = trunc i128 %.0169 to i64
  %21 = add i64 %20, -2
  %22 = getelementptr i128, ptr %.unpack156, i64 %21
  %23 = load i128, ptr %22, align 8, !tbaa !3
  %24 = add i128 %23, -1
  %25 = add i64 %20, -1
  %26 = getelementptr i128, ptr %.unpack156, i64 %25
  %27 = load i128, ptr %26, align 8, !tbaa !3
  %28 = icmp sgt i128 %24, %27
  br i1 %28, label %29, label %34

29:                                               ; preds = %19
  %30 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.a9352283a1c8461d59311b47ec60a0e9, i32 14)
  %31 = call i1 @_FortranAioOutputAscii(ptr %30, ptr nonnull @_QQcl.4E6F, i64 2)
  %32 = call i32 @_FortranAioEndIoStatement(ptr %30)
  %33 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

34:                                               ; preds = %19
  %35 = icmp eq i128 %24, %27
  br i1 %35, label %36, label %37

36:                                               ; preds = %34
  store i128 %24, ptr %22, align 8, !tbaa !3
  br label %37

37:                                               ; preds = %36, %34
  %38 = add i128 %.0169, -1
  %.0133 = add i128 %.0133170, -1
  %39 = icmp sgt i128 %.0133, 0
  br i1 %39, label %19, label %._crit_edge

._crit_edge:                                      ; preds = %37, %0
  %40 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.a9352283a1c8461d59311b47ec60a0e9, i32 20)
  %41 = call i1 @_FortranAioOutputAscii(ptr %40, ptr nonnull @_QQcl.596573, i64 3)
  %42 = call i32 @_FortranAioEndIoStatement(ptr %40)
  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

declare {} @_FortranAStopStatement(i32, i1, i1) 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}
