fun main(args : Array<String>) {
    val (N, M) = readLine()!!.split(" ").map { it.toInt() }
    val a = mutableListOf<Int>()
    (1..M).forEach {
        val num = readLine()!!.toInt()
        a.add(num)
    }

    val dp = Array(N + 1, { 0L })
    dp[0] = 1
    val MOD = 1000000007

    var index = 0
    (1..N).forEach { n ->
        val isNthBroken = if (index >= M) false else a[index] == n
        if (isNthBroken) {
            index++
        }

        if (isNthBroken) {
            dp[n] = 0
        } else {
            if (n -2 >= 0) {
                dp[n] = (dp[n-1] + dp[n-2]) % MOD
            } else {
                dp[n] = dp[n-1]
            }
        }
    }
    println(dp[N])
}