fun main(args: Array<String>) {
    val (N, M) = listOfInt()
    var K = Array(N + 1) { true }
    repeat(M) { K[nextInt()] = false }
    var dp = Array(N + 2) { 0 }
    dp[N] = 1
    val MOD = 1000000007
    for (n in N - 1 downTo 0) {
        if (K[n]) dp[n] = (dp[n + 1] + dp[n + 2]) % MOD
    }
    println(dp[0])
}
fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map(String::toInt)