import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val m = sc.nextInt()
    val a = (0 until m).map { 
        sc.nextInt()
     }

     abc129c(n, a)
}

fun abc129c(n: Int, a: List<Int>) {
    val safe = BooleanArray(n + 1) { true }
    for (ai in a) {
        safe[ai] = false
    }
    val mod: Long = (Math.pow(10.0, 9.0) + 7).toLong()
    val dp = LongArray(n + 1) { 0 }
    dp[0] = 1L
    if (safe[1]) dp[1] = 1L
    for (i in 2..n) {
        if (safe[i - 2]) dp[i] += dp[i - 2]
        if (safe[i - 1]) dp[i] += dp[i - 1]
        dp[i] %= mod
    } 
    val ans: Long = dp[n]
    println(ans)
}
