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 dp = LongArray(n + 1) { 0 }
    dp[0] = 1
    if (safe[1]) {
        dp[1] = 1
    }
    for (i in 2..n) {
        if (safe[i - 1]) dp[i] += dp[i - 1]
        if (safe[i - 2]) dp[i] += dp[i - 2]
    } 
    val mod: Long = (Math.pow(10.0, 9.0) + 7).toLong()
    val ans: Long = dp[n] % mod
    println(ans)
}
