program abc129c
  implicit none
  integer(16) :: n, m, i, j, moder
  integer(16), allocatable :: a(:), dp(:)
  logical, allocatable :: ok_step(:)

  moder=10**9+7

  read(*,*) n, m
  allocate(a(m),ok_step(0:n),dp(0:n))

  ok_step(:) = .True.
  do i = 1, m
    read(*,*) a(i)
    ok_step(a(i)) = .False.
  end do

  dp(:) = 0
  dp(0) = 1
  do i = 0, N-1
    do j = i+1, min(n, i+2)
      if (ok_step(j)) then
        !j段目が壊れていない時
        dp(j) = dp(j) + dp(i)
        dp(j) = mod(dp(j),moder)
      endif
    enddo
  enddo

  print *, dp(n)

end program abc129c

; 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
@_QFEdp.0 = internal unnamed_addr global ptr null
@_QFEdp.7 = internal unnamed_addr global i64 1
@_QFEdp.8 = internal unnamed_addr global i64 0
@_QFEok_step.0 = internal unnamed_addr global ptr null
@_QFEok_step.7 = internal unnamed_addr global i64 1
@_QQcl.2d8b8cbf59fa50b130ea9aff20c754e9 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4108/source.f\00"
@_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 i128, align 8
  %2 = alloca i128, align 8
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.2d8b8cbf59fa50b130ea9aff20c754e9, i32 9)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 16)
  %5 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 16)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %7 = load i128, ptr %1, align 8, !tbaa !3
  %8 = trunc i128 %7 to i64
  %9 = call i64 @llvm.smax.i64(i64 %8, i64 0)
  %10 = shl i64 %9, 4
  %11 = call ptr @malloc(i64 %10)
  store ptr %11, ptr @_QFEa.0, align 8, !tbaa !7
  %12 = load i128, ptr %2, align 8, !tbaa !3
  %13 = trunc i128 %12 to i64
  %14 = add i64 %13, 1
  %15 = call i64 @llvm.smax.i64(i64 %14, i64 0)
  %16 = shl i64 %15, 2
  %17 = call ptr @malloc(i64 %16)
  %18 = icmp ugt i64 %13, 9223372036854775806
  %19 = zext i1 %18 to i64
  store ptr %17, ptr @_QFEok_step.0, align 8, !tbaa !7
  store i64 %19, ptr @_QFEok_step.7, align 8, !tbaa !7
  %20 = shl i64 %15, 4
  %21 = call ptr @malloc(i64 %20)
  store ptr %21, ptr @_QFEdp.0, align 8, !tbaa !7
  store i64 %19, ptr @_QFEdp.7, align 8, !tbaa !7
  store i64 %15, ptr @_QFEdp.8, align 8, !tbaa !7
  br i1 %18, label %.preheader, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %min.iters.check = icmp ult i64 %15, 8
  br i1 %min.iters.check, label %.lr.ph.preheader465, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %15, 9223372036854775800
  %ind.end = and i64 %15, 7
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %22 = getelementptr i32, ptr %17, i64 %index
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %22, align 4, !tbaa !3
  %23 = getelementptr i32, ptr %22, i64 4
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %23, align 4, !tbaa !3
  %index.next = add nuw i64 %index, 8
  %24 = icmp eq i64 %index.next, %n.vec
  br i1 %24, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %15, %n.vec
  br i1 %cmp.n, label %.preheader, label %.lr.ph.preheader465

.lr.ph.preheader465:                              ; preds = %.lr.ph.preheader, %middle.block
  %.ph = phi i64 [ %15, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  %.ph466 = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %middle.block, %0
  %25 = icmp sgt i64 %8, 0
  br i1 %25, label %.lr.ph448, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph.preheader465, %.lr.ph
  %26 = phi i64 [ %30, %.lr.ph ], [ %.ph, %.lr.ph.preheader465 ]
  %27 = phi i64 [ %29, %.lr.ph ], [ %.ph466, %.lr.ph.preheader465 ]
  %28 = getelementptr i32, ptr %17, i64 %27
  store i32 1, ptr %28, align 4, !tbaa !3
  %29 = add nuw nsw i64 %27, 1
  %30 = add nsw i64 %26, -1
  %31 = icmp ugt i64 %26, 1
  br i1 %31, label %.lr.ph, label %.preheader, !llvm.loop !12

.lr.ph448:                                        ; preds = %.preheader, %.lr.ph448
  %32 = phi i64 [ %44, %.lr.ph448 ], [ 1, %.preheader ]
  %33 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.2d8b8cbf59fa50b130ea9aff20c754e9, i32 14)
  %.unpack412 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %34 = add i64 %32, -1
  %35 = getelementptr i128, ptr %.unpack412, i64 %34
  %36 = call i1 @_FortranAioInputInteger(ptr %33, ptr %35, i32 16)
  %37 = call i32 @_FortranAioEndIoStatement(ptr %33)
  %.unpack424 = load ptr, ptr @_QFEok_step.0, align 8, !tbaa !7
  %.unpack431.unpack.unpack = load i64, ptr @_QFEok_step.7, align 8, !tbaa !7
  %.unpack436 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %38 = add i64 %32, -1
  %39 = getelementptr i128, ptr %.unpack436, i64 %38
  %40 = load i128, ptr %39, align 8, !tbaa !3
  %41 = trunc i128 %40 to i64
  %42 = sub i64 %41, %.unpack431.unpack.unpack
  %43 = getelementptr i32, ptr %.unpack424, i64 %42
  store i32 0, ptr %43, align 4, !tbaa !3
  %44 = add nuw i64 %32, 1
  %exitcond.not = icmp eq i64 %32, %8
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph448

._crit_edge.loopexit:                             ; preds = %.lr.ph448
  %.unpack340.pre = load ptr, ptr @_QFEdp.0, align 8, !tbaa !7
  %.unpack347.unpack.unpack349.pre = load i64, ptr @_QFEdp.8, align 8, !tbaa !7
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %.unpack383.unpack.unpack = phi i64 [ %.unpack431.unpack.unpack, %._crit_edge.loopexit ], [ %19, %.preheader ]
  %.unpack376 = phi ptr [ %.unpack424, %._crit_edge.loopexit ], [ %17, %.preheader ]
  %.unpack347.unpack.unpack349 = phi i64 [ %.unpack347.unpack.unpack349.pre, %._crit_edge.loopexit ], [ %15, %.preheader ]
  %.unpack340 = phi ptr [ %.unpack340.pre, %._crit_edge.loopexit ], [ %21, %.preheader ]
  %.not459 = icmp slt i64 %.unpack347.unpack.unpack349, 1
  br i1 %.not459, label %._crit_edge451, label %.lr.ph450.preheader

.lr.ph450.preheader:                              ; preds = %._crit_edge
  %45 = shl nuw i64 %.unpack347.unpack.unpack349, 4
  call void @llvm.memset.p0.i64(ptr align 8 %.unpack340, i8 0, i64 %45, i1 false), !tbaa !3
  br label %._crit_edge451

._crit_edge451:                                   ; preds = %.lr.ph450.preheader, %._crit_edge
  %.unpack359.unpack.unpack = load i64, ptr @_QFEdp.7, align 8, !tbaa !7
  %46 = sub i64 0, %.unpack359.unpack.unpack
  %47 = getelementptr i128, ptr %.unpack340, i64 %46
  store i128 1, ptr %47, align 8, !tbaa !3
  %48 = load i128, ptr %2, align 8, !tbaa !3
  %49 = trunc i128 %48 to i64
  %50 = icmp sgt i64 %49, 0
  br i1 %50, label %.lr.ph456, label %._crit_edge457

.lr.ph456:                                        ; preds = %._crit_edge451, %._crit_edge454
  %51 = phi i64 [ %82, %._crit_edge454 ], [ %49, %._crit_edge451 ]
  %52 = phi i128 [ %53, %._crit_edge454 ], [ 0, %._crit_edge451 ]
  %53 = add nuw nsw i128 %52, 1
  %54 = trunc i128 %53 to i64
  %55 = load i128, ptr %2, align 8, !tbaa !3
  %56 = add nuw nsw i128 %52, 2
  %57 = call i128 @llvm.smin.i128(i128 %55, i128 %56)
  %58 = trunc i128 %57 to i64
  %59 = sub i64 1, %54
  %60 = add i64 %59, %58
  %61 = icmp sgt i64 %60, 0
  br i1 %61, label %.lr.ph453, label %._crit_edge454

.lr.ph453:                                        ; preds = %.lr.ph456
  %62 = trunc i128 %52 to i64
  %63 = sub i64 %62, %.unpack359.unpack.unpack
  %64 = getelementptr i128, ptr %.unpack340, i64 %63
  br label %65

65:                                               ; preds = %.lr.ph453, %78
  %66 = phi i64 [ %60, %.lr.ph453 ], [ %80, %78 ]
  %67 = phi i64 [ %54, %.lr.ph453 ], [ %79, %78 ]
  %68 = sub i64 %67, %.unpack383.unpack.unpack
  %69 = getelementptr i32, ptr %.unpack376, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !3
  %.not = icmp eq i32 %70, 0
  br i1 %.not, label %78, label %71

71:                                               ; preds = %65
  %72 = sub i64 %67, %.unpack359.unpack.unpack
  %73 = getelementptr i128, ptr %.unpack340, i64 %72
  %74 = load i128, ptr %73, align 8, !tbaa !3
  %75 = load i128, ptr %64, align 8, !tbaa !3
  %76 = add i128 %75, %74
  %77 = srem i128 %76, 1000000007
  store i128 %77, ptr %73, align 8, !tbaa !3
  br label %78

78:                                               ; preds = %71, %65
  %79 = add nuw i64 %67, 1
  %80 = add nsw i64 %66, -1
  %81 = icmp sgt i64 %66, 1
  br i1 %81, label %65, label %._crit_edge454

._crit_edge454:                                   ; preds = %78, %.lr.ph456
  %82 = add nsw i64 %51, -1
  %83 = icmp sgt i64 %51, 1
  br i1 %83, label %.lr.ph456, label %._crit_edge457

._crit_edge457:                                   ; preds = %._crit_edge454, %._crit_edge451
  %84 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.2d8b8cbf59fa50b130ea9aff20c754e9, i32 30)
  %.unpack364 = load ptr, ptr @_QFEdp.0, align 8, !tbaa !7
  %.unpack371.unpack.unpack = load i64, ptr @_QFEdp.7, align 8, !tbaa !7
  %85 = load i128, ptr %2, align 8, !tbaa !3
  %86 = trunc i128 %85 to i64
  %87 = sub i64 %86, %.unpack371.unpack.unpack
  %88 = getelementptr i128, ptr %.unpack364, i64 %87
  %89 = load i128, ptr %88, align 8, !tbaa !3
  %90 = call i1 @_FortranAioOutputInteger128(ptr %84, i128 %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 @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger128(ptr, i128) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i128 @llvm.smin.i128(i128, i128) #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, !11}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !11, !10}
