import java.util.*

fun main(args:Array<String>){
    val (n,m) = readLine()!!.split(" ").map{it.toInt()}
    val a = (1 .. m).map{readLine()!!.toInt()}
    var dp = LongArray(n + 1)
    dp[0] = 1
    var j = 0
    val mod = 1000000007
    for(i in 1 .. n){
        if(j < m && a[j] == i){
            j++
        }
        else{
            dp[i] = (dp[i - 1] + if(i >= 2) dp[i - 2] else 0L) % mod
        }
    }
    println(dp[n])
}
