fun main(args:Array<String>){
    val mod = 1000000007
    val line1 = readLine()!!.split(" ").map { it.toInt() }
    //nは最上段の数,mは壊れている床の数
    val n = line1[0]
    val m = line1[1]
    val list= mutableListOf<Int>()
    for(i in 1..m){
        list.add(readLine()!!.toInt())
    }
    //pnはn段目にたどり着く場合の数,pn1はn-1段目にたどり着く場合の数
    var pn1 = if(list.contains(1)) 0L else 1L
    var pn = if(list.contains(2)) 0L else pn1+1L
    if(pn1==0L && pn ==0L){
        println(0)
        return
    }
    
    when(n){
        1->
        {println(1)
            return 
        }
        2->{
            println(pn)
            return
        }
    }
    
    var count = if(pn==2L) 0 else 1
    for(i in 3..n){
        val pnext = if(count<list.size && list[count] == i)
        {
            count +=1
            0L
        }
        else pn+pn1

        pn1 = pn % mod
        pn = pnext % mod
    }
    println(pn)
}