import Foundation

let args = readLine()!.split(separator: " ")
let N = Int(args[0])!
let M = Int(args[1])!
let a = [Int](unsafeUninitializedCapacity: M) { buffer, _ in
    for m in 0 ..< M {
        buffer[m] = Int(readLine()!)!
    }
}

var step = 0
var s1 = 1
var s2 = 0

var n = N - 1
var m = M - 1
while 0 <= n {
    let isStepBroken = 0 <= m && a[m] == n
    if isStepBroken {
        step = 0
        m -= 1
    } else {
        step = (s1 + s2) % 1_000_000_007
    }
    s2 = s1
    s1 = step
    n -= 1
}
let answer = step

print(answer)
