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

val md = 1000000000 + 7

val dic = mutableListOf(0L, 1L, 2L)
fun setDic(num:Int) {
    for(i in 3..num) {
        val tmp = (dic[i-2] + dic[i-1]) % md
        dic.add(tmp)
    }
}
