import Foundation

func readWords<T>(_ f: (Substring) -> T) -> [T] {
    return readLine()!.split(separator: " ").map(f)
}


func main() {
    let nm = readWords { Int($0)! }
    let n = nm[0]
    let m = nm[1]
    let mod = 1_000_000_007

    var dp = Array(repeating: 0, count: n+1)
    dp[0] = 1

    var safe = Array(repeating: true, count: n+1)

    for _ in 0..<m {
        let a = Int(readLine()!)!
        safe[a] = false
    }

    for i in 0..<n {
        if i+1 <= n && safe[i+1] {
            dp[i+1] += dp[i]
            dp[i+1] %= mod
        }

        if i+2 <= n && safe[i+2] {
            dp[i+2] += dp[i]
            dp[i+2] %= mod
        }
    }
    print(dp.last!)
}

main()

