program main
  implicit none
  integer :: n, m, i
  integer, allocatable :: a(:), dp(:)
  logical, allocatable :: broken(:)
  read (*, *) n, m
  allocate (a(m), dp(-1:n), broken(n))
  do i = 1, m
    read (*, *) a(i)
  end do
  broken(:) = .false.
  do i = 1, m
    broken(a(i)) = .true.
  end do
  dp(-1) = 0
  dp(0) = 1
  do i = 1, n
    dp(i) = dp(i - 1) + dp(i - 2)
    if (broken(i)) dp(i) = 0
    dp(i) = mod(dp(i), 1000000007)
  end do
  write (*, "(i0)") dp(n)
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
@_QFEbroken.0 = internal unnamed_addr global ptr null
@_QFEbroken.8 = internal unnamed_addr global i64 0
@_QFEdp.0 = internal unnamed_addr global ptr null
@_QFEdp.7 = internal unnamed_addr global i64 1
@_QQcl.fcc81feb7eec0af68c1a03ac5b67f3e1 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4106/source.f\00"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_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.fcc81feb7eec0af68c1a03ac5b67f3e1, i32 6)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %5 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 4)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %7 = load i32, ptr %1, 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
  %12 = load i32, ptr %2, align 4, !tbaa !3
  %13 = call i32 @llvm.smax.i32(i32 %12, i32 -2)
  %14 = sext i32 %13 to i64
  %15 = add nsw i64 %14, 2
  %16 = shl nuw nsw i64 %15, 2
  %17 = call ptr @malloc(i64 %16)
  %18 = icmp eq i64 %15, 0
  %19 = select i1 %18, i64 1, i64 -1
  store ptr %17, ptr @_QFEdp.0, align 8, !tbaa !7
  store i64 %19, ptr @_QFEdp.7, align 8, !tbaa !7
  %20 = call i32 @llvm.smax.i32(i32 %12, i32 0)
  %21 = zext i32 %20 to i64
  %22 = shl nuw nsw i64 %21, 2
  %23 = call ptr @malloc(i64 %22)
  store ptr %23, ptr @_QFEbroken.0, align 8, !tbaa !7
  store i64 %21, ptr @_QFEbroken.8, align 8, !tbaa !7
  %24 = icmp sgt i32 %7, 0
  br i1 %24, label %.lr.ph.preheader, label %._crit_edge

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %26 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.fcc81feb7eec0af68c1a03ac5b67f3e1, i32 9)
  %.unpack465 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %27 = add nsw i64 %indvars.iv, -1
  %28 = getelementptr i32, ptr %.unpack465, i64 %27
  %29 = call i1 @_FortranAioInputInteger(ptr %26, ptr %28, i32 4)
  %30 = call i32 @_FortranAioEndIoStatement(ptr %26)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %25
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.unpack.pre = load ptr, ptr @_QFEbroken.0, align 8, !tbaa !7
  %.unpack352.unpack.unpack354.pre = load i64, ptr @_QFEbroken.8, align 8, !tbaa !7
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %.unpack352.unpack.unpack354 = phi i64 [ %.unpack352.unpack.unpack354.pre, %._crit_edge.loopexit ], [ %21, %0 ]
  %.unpack = phi ptr [ %.unpack.pre, %._crit_edge.loopexit ], [ %23, %0 ]
  %.not486 = icmp slt i64 %.unpack352.unpack.unpack354, 1
  br i1 %.not486, label %._crit_edge479, label %.lr.ph478.preheader

.lr.ph478.preheader:                              ; preds = %._crit_edge
  %31 = shl nuw i64 %.unpack352.unpack.unpack354, 2
  call void @llvm.memset.p0.i64(ptr align 4 %.unpack, i8 0, i64 %31, i1 false), !tbaa !3
  br label %._crit_edge479

._crit_edge479:                                   ; preds = %.lr.ph478.preheader, %._crit_edge
  %32 = load i32, ptr %1, align 4, !tbaa !3
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph481, label %._crit_edge482

.lr.ph481:                                        ; preds = %._crit_edge479
  %34 = zext i32 %32 to i64
  %.unpack453 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %xtraiter = and i64 %34, 3
  %35 = icmp ult i32 %32, 4
  br i1 %35, label %._crit_edge482.loopexit.unr-lcssa, label %.lr.ph481.new

.lr.ph481.new:                                    ; preds = %.lr.ph481
  %unroll_iter = and i64 %34, 4294967292
  br label %36

36:                                               ; preds = %36, %.lr.ph481.new
  %indvars.iv488 = phi i64 [ 1, %.lr.ph481.new ], [ %indvars.iv.next489.3, %36 ]
  %niter = phi i64 [ 0, %.lr.ph481.new ], [ %niter.next.3, %36 ]
  %37 = add nsw i64 %indvars.iv488, -1
  %38 = getelementptr i32, ptr %.unpack453, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !3
  %40 = sext i32 %39 to i64
  %41 = add nsw i64 %40, -1
  %42 = getelementptr i32, ptr %.unpack, i64 %41
  store i32 1, ptr %42, align 4, !tbaa !3
  %indvars.iv.next489 = add nuw nsw i64 %indvars.iv488, 1
  %43 = getelementptr i32, ptr %.unpack453, i64 %indvars.iv488
  %44 = load i32, ptr %43, align 4, !tbaa !3
  %45 = sext i32 %44 to i64
  %46 = add nsw i64 %45, -1
  %47 = getelementptr i32, ptr %.unpack, i64 %46
  store i32 1, ptr %47, align 4, !tbaa !3
  %indvars.iv.next489.1 = add nuw nsw i64 %indvars.iv488, 2
  %48 = getelementptr i32, ptr %.unpack453, i64 %indvars.iv.next489
  %49 = load i32, ptr %48, align 4, !tbaa !3
  %50 = sext i32 %49 to i64
  %51 = add nsw i64 %50, -1
  %52 = getelementptr i32, ptr %.unpack, i64 %51
  store i32 1, ptr %52, align 4, !tbaa !3
  %53 = getelementptr i32, ptr %.unpack453, i64 %indvars.iv.next489.1
  %54 = load i32, ptr %53, align 4, !tbaa !3
  %55 = sext i32 %54 to i64
  %56 = add nsw i64 %55, -1
  %57 = getelementptr i32, ptr %.unpack, i64 %56
  store i32 1, ptr %57, align 4, !tbaa !3
  %indvars.iv.next489.3 = add nuw nsw i64 %indvars.iv488, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge482.loopexit.unr-lcssa, label %36

._crit_edge482.loopexit.unr-lcssa:                ; preds = %36, %.lr.ph481
  %indvars.iv488.unr = phi i64 [ 1, %.lr.ph481 ], [ %indvars.iv.next489.3, %36 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge482, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge482.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv488.epil = phi i64 [ %indvars.iv.next489.epil, %.epil.preheader ], [ %indvars.iv488.unr, %._crit_edge482.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge482.loopexit.unr-lcssa ]
  %58 = add nsw i64 %indvars.iv488.epil, -1
  %59 = getelementptr i32, ptr %.unpack453, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !3
  %61 = sext i32 %60 to i64
  %62 = add nsw i64 %61, -1
  %63 = getelementptr i32, ptr %.unpack, i64 %62
  store i32 1, ptr %63, align 4, !tbaa !3
  %indvars.iv.next489.epil = add nuw nsw i64 %indvars.iv488.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge482, label %.epil.preheader, !llvm.loop !9

._crit_edge482:                                   ; preds = %._crit_edge482.loopexit.unr-lcssa, %.epil.preheader, %._crit_edge479
  %.unpack357 = load ptr, ptr @_QFEdp.0, align 8, !tbaa !7
  %.unpack364.unpack.unpack = load i64, ptr @_QFEdp.7, align 8, !tbaa !7
  %64 = xor i64 %.unpack364.unpack.unpack, -1
  %65 = getelementptr i32, ptr %.unpack357, i64 %64
  store i32 0, ptr %65, align 4, !tbaa !3
  %66 = sub i64 0, %.unpack364.unpack.unpack
  %67 = getelementptr i32, ptr %.unpack357, i64 %66
  store i32 1, ptr %67, align 4, !tbaa !3
  %68 = load i32, ptr %2, align 4, !tbaa !3
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %.lr.ph484, label %._crit_edge485

.lr.ph484:                                        ; preds = %._crit_edge482
  %70 = zext i32 %68 to i64
  %71 = mul i64 %.unpack364.unpack.unpack, -4
  %uglygep = getelementptr i8, ptr %.unpack357, i64 %71
  %load_initial = load i32, ptr %uglygep, align 4
  br label %72

72:                                               ; preds = %.lr.ph484, %72
  %store_forwarded = phi i32 [ %load_initial, %.lr.ph484 ], [ %83, %72 ]
  %indvars.iv492 = phi i64 [ 1, %.lr.ph484 ], [ %indvars.iv.next493, %72 ]
  %73 = add nsw i64 %indvars.iv492, -2
  %74 = sub i64 %73, %.unpack364.unpack.unpack
  %75 = getelementptr i32, ptr %.unpack357, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !3
  %77 = add i32 %76, %store_forwarded
  %78 = sub i64 %indvars.iv492, %.unpack364.unpack.unpack
  %79 = getelementptr i32, ptr %.unpack357, i64 %78
  store i32 %77, ptr %79, align 4, !tbaa !3
  %80 = add nsw i64 %indvars.iv492, -1
  %81 = getelementptr i32, ptr %.unpack, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !3
  %.not = icmp eq i32 %82, 0
  %.op = srem i32 %77, 1000000007
  %83 = select i1 %.not, i32 %.op, i32 0
  store i32 %83, ptr %79, align 4, !tbaa !3
  %indvars.iv.next493 = add nuw nsw i64 %indvars.iv492, 1
  %exitcond495.not = icmp eq i64 %indvars.iv492, %70
  br i1 %exitcond495.not, label %._crit_edge485, label %72

._crit_edge485:                                   ; preds = %72, %._crit_edge482
  %84 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.fcc81feb7eec0af68c1a03ac5b67f3e1, i32 22)
  %.unpack381 = load ptr, ptr @_QFEdp.0, align 8, !tbaa !7
  %.unpack388.unpack.unpack = load i64, ptr @_QFEdp.7, align 8, !tbaa !7
  %85 = load i32, ptr %2, align 4, !tbaa !3
  %86 = sext i32 %85 to i64
  %87 = sub i64 %86, %.unpack388.unpack.unpack
  %88 = getelementptr i32, ptr %.unpack381, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !3
  %90 = call i1 @_FortranAioOutputInteger32(ptr %84, i32 %89)
  %91 = call i32 @_FortranAioEndIoStatement(ptr %84)
  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 @_FortranAioOutputInteger32(ptr, i32) 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 nounwind willreturn memory(argmem: write) }

!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}
!10 = !{!"llvm.loop.unroll.disable"}
