fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(" ").map { it.toInt() }
    val a = mutableListOf<Int>()
    a.add(0)
    for (i in 1..m) {
        a.add(readLine()!!.toInt())
        if (i > 1) {
            if (a[i] == a[i - 1] + 1) {
                println(0)
                return
            }
        }
    }
    a.add(n)
    var sum = 1L
    val wa = 1000000007
    val f = IntArray(100000)
    f[0] = 1
    f[1] = 1
    for (i in 2 until 100000) {
        f[i] = f[i - 1] + f[i - 2]
    }
    for (i in 1..m + 1) {
        var steps = a[i] - a[i - 1] - 1
        if (i != m + 1 && steps > 0) steps--
        println(steps)
        var te = f[steps]
        te %= wa
        sum *= te
        sum %= wa
    }
    println(sum)
}
