private fun readInts() = readLine()!!.split(" ").map(String::toInt)

private val MOD = 1000000007
private val NOT_YET = -1

fun main(args: Array<String>) {
    val (N, M) = readInts()
    val a = (0 until M).map { readLine()!!.toInt() - 1 } // 0-indexed

    if (N == 1) {
        println(1)
        return
    }

    val ways = Array(N) { NOT_YET }
    a.forEach { hole -> ways[hole] = 0 }

    if (ways[0] == NOT_YET) ways[0] = 1
    if (ways[1] == NOT_YET) ways[1] = 1 + ways[0]
  
    (2 until N)
        .filter { position -> ways[position] == NOT_YET }
        .asSequence()
        .forEach { ways[it] = (ways[it - 1] + ways[it - 2]) % MOD }

    println(ways.last())
}
