fun main(args: Array<String>) = ripPro0408d()

fun ripPro0408d() {
    val (n, m) = readLine()!!.split(' ').map { it.toInt() }
    val broken = (1..m).map { readLine()!!.toInt() }.toSet()

    for (i in 0 until n - 1) if (i in broken && i + 1 in broken) return println(0)

    val fib = LongArray(n + 1)
    fib[0] = 1
    fib[1] = 1
    for (i in 0 until n - 1) fib[i + 2] = (fib[i + 1] + fib[i]) % MOD

    var answer = 1L

    var left = 0
    var right: Int

    while (left < n) {
        while (left < n && left in broken) left++
        right = left
        while (right < n && right + 1 !in broken) right++
        answer *= fib[right - left]
        answer %= MOD
        while (left < n && left !in broken) left++
    }

    println(answer)
}

private const val MOD = (1e9 + 7).toLong()
