import scala.io.StdIn._

object Main extends App {


  val Array(n,m) = readLine().split(" ").map(_.toInt)

  val as = Array.fill(m)(readInt())

  def solve() = {
    val broken = Array.fill(n+2)(false)
    as.foreach { num =>
      broken(num) = true
    }

    val mod = (1e9 + 7).toInt
    val dp = Array.fill(n+2)(0)
    dp(n) = 1

    for(i <- n-1 to 0 by -1) {
      if(!broken(i)) {
        dp(i) = (dp(i+1) + dp(i+2)) % mod
      }
    }
    dp(0)
  }

  println(solve())

}

