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)

  do i = 0, n
    print *, i, dp(i)
  enddo

end program abc129c
