import java.util.*
import java.math.*

fun main(args: Array<String>) {

    var (N, M) = readLine()!!.split(" ").map { it.toInt() }
//    var N = readLine()!!.toInt()
//    val D = readLine()!!.split(" ").map { it.toLong() }
//    val A = readLine()!!.split(" ").map { it.toInt() }.toIntArray()

    val mod = 1000000007L
    val dp = LongArray(N+1)
    var a = readLine()!!.toInt()
    M--
    dp[0] = 1
    dp[1] = if (a == 1) {if (M-- > 0) a = readLine()!!.toInt();0} else 1

    for (n in 2 .. N) {
        if (n == a) {
            if (M-- > 0)
                a = readLine()!!.toInt()
            continue
        }
        dp[n] = (dp[n-1] + dp[n-2]) % mod
    }

    println(dp[N])

//    println("%.9f".format(ans))
}
