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 }
    for (hole in a) ways[hole] = 0

    ways[0] = if (ways[0] != NOT_YET) 0 else 1
    ways[1] = if (ways[1] != NOT_YET) 0 else ways[0] + 1
    if (N == 2) {
        println(ways[0] + ways[1])
        return
    }

    for (position in 2 until N) {
        if (ways[position] == NOT_YET) {
            ways[position] = (ways[position - 1] + ways[position - 2]) % MOD
        }
    }

    println(ways.last())
}