fun main(args: Array<String>) {
    val (N, M) = readLine()!!.split(" ").map(String::toInt)
    val A = Array(M) { readLine()!!.toInt() }

    val d = 1000000007
    val DP = LongArray(N + 1)

    DP[0] = 1
    DP[1] = 1
    A.forEach {
        DP[it] = -1
    }
    for (i in 2 until DP.size) {
        if (DP[i] == -1L) {
            continue
        }
        when {
            DP[i - 1] != -1L && DP[i - 2] != -1L -> DP[i] = (DP[i - 1] + DP[i - 2]) % d
            DP[i - 1] != -1L && DP[i - 2] == -1L -> DP[i] = DP[i - 1] % d
            DP[i - 1] == -1L && DP[i - 2] != -1L -> DP[i] = DP[i - 2] % d
            DP[i - 1] == -1L && DP[i - 2] == -1L -> {
                println(0)
                return
            }
        }
//        DP.joinToString(separator = ",").let(::println)
    }
    println(DP[N])
}
