import java.io.PrintWriter
import java.util.*

val pw = PrintWriter(System.out)
val DIVIDER: Long = (1e+9 + 7).toLong()
fun main(args: Array<String>) {
    val (n, m) = readListOfInt()
    val floors: MutableList<Long> = MutableList<Long>(n + 1, {0L})
    for(i in 0 until m) {
        val a = readInt() 
        floors[a] = -1L
    }

    floors[1] = if(floors[1] == -1L) 0 else 1

    if(n > 1) {
        floors[2] = if(floors[2] == -1L) 0 else floors[1] + 1L
        for(i in 3 .. n) {
            if(floors[i] == -1L) {
                floors[i] = 0L
                continue
            } 
            val one_step = floors[i-1]
            val two_step = floors[i-2]
            floors[i] = (one_step + two_step) % DIVIDER
        }
    }
    println(floors[n] % DIVIDER)

    pw.flush()
}

fun inputList() = 
    readLine()!!.split(" ").map(String::toInt)

fun sum_digits(num_: Long): Long {
    var num = num_
    var rtn: Long = 0
    while(num != 0.toLong()) {
        val tmp = num % 10
        rtn += tmp
        num /= 10
    }
    return rtn
}

/****** Decrared Functions ******/

// IO
fun read() = readLine()!!
fun readInt() = read().toInt()
fun readLong() = read().toLong()
fun readDouble() = read().toDouble()
fun readListOfString() = read().split(" ")
fun readListOfInt() = readListOfString().map { it.toInt() }
fun readListOfLong() = readListOfString().map { it.toLong() }
fun readListOfDouble() = readListOfString().map { it.toDouble() }


//fun println(value : Any) {
//    pw.println(value)
//}

fun gcd(a: Long, b: Long): Long = 
    if(b != 0L) a else gcd(b, a % b)

fun lcm(a: Long, b: Long) = 
    if(b==0L) a else gcd(b, a % b)
