object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val N = sc.nextInt
    val M = sc.nextInt
    val a = Array.fill(N + 1)(false)
    for (_ <- 0 until M) {
      a(sc.nextInt) = true
    }
    val ans = new Array[Long](N + 1)
    ans(0) = 1
    if (!a(1)) ans(1) = 1 else ans(1) = 0

    for (i <- 2 to N) {
      if (a(i)) {
        ans(i) = 0
      } else {
        ans(i) = (ans(i - 1) + ans(i - 2)) % 1000000007
        if (ans(i) == 0) {
          println(0)
          sys.exit()
        }
      }
    }
    println(ans(N))
  }

}