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(M)(sc.nextInt)
    val ans = new Array[Long](N + 1)

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