fun main(arr:Array<String>) {
    val (n,m) = readLine()!!.split(" ").map { it.toInt() }
    setDic(n)
    val brokenStepList = (1..m).map { readLine()!!.toInt() }.toMutableList()
    brokenStepList.add(n+1)
    var current = 0
    var ans = 1L
    for(broken in brokenStepList) {
        if(current >= broken) {
            println(0)
            return
        }
        val tmp = broken - current - 1
        if(tmp > 0) {
            ans *= dic[tmp]
            ans %= md
        }
        current = broken + 1
    }
    println(ans)
}

val dic = mutableListOf<Long>()
val md = 1000000000 + 7
fun setDic(num:Int) {
    dic.add(0)
    dic.add(1)
    dic.add(2)
    (3..num+1).forEach { dic.add((dic[it-1] + dic[it-2])%md) }
}