fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(" ").map { it.toInt() }
    var ng = (1 .. m).map{ readLine()!!.toInt() }
    var dp = mutableListOf<Int>()
    if(ng.contains(1)){
        if(ng.contains(2)){
            dp = mutableListOf(0,0,0)
        }
        else {
            dp = mutableListOf(0,0,1)
        }
    }
    else if(ng.contains(2)){
        dp = mutableListOf(0,1,0)
    }
    else dp = mutableListOf(0,1,2)

    for (i in 3 .. n){
        if (ng.contains(i)){
            dp.add(0)
            ng.drop(1)
        }
        else{
            dp.add((dp[i - 1] + dp[i - 2]) % 1000000007)
        }
    }

    println(dp.last())
}