fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(" ").map { it.toInt() }
    var ng = (1 .. m).map{ readLine()!!.toInt() }
    var dp = mutableListOf(0,1,2)
    for (i in 3 .. n){
        if (ng.contains(i)){
            dp.add(0)
        }
        else if (dp[i - 1] == dp[i - 2]){
            dp.add(dp.last() + 2)
        }
        else{
            dp.add(dp[i - 1] + dp[i - 2])
        }
    }
    println(dp.last())
}