import Foundation

// Example1
//let N = 6
//let M = 1
//let a = [3]

// Example2
//let N = 10
//let M = 2
//let a = [4, 5]

// Example3
//let N = 100
//let M = 5
//let a = [1, 23, 45, 67, 89]

let array = readLine()!.split(separator: " ")
let N = Int(array[0])!
let M = Int(array[1])!
var a = [Int](repeating: 0, count: M)
for m in 0 ..< M {
    a[m] = Int(readLine()!)!
}

/*
 Example1:
 ---------------------
 n | N1, N2 | S
 ---------------------
 0 |  1,  2 | 2 + 2 -> 4
 1 |  2,  3 | 2 + 0 -> 2
 2 |  3,  4 | 0 + 2 -> 2
 3 |  7,  7 | 0 + 0 -> 0
 4 |  5,  6 | 1 + 1 -> 2
 5 |  6,  7 | 1 + 0 -> 1
 6 |                   1 ; goal
 7 |                   0 ; over or broken
*/

var N1 = [Int](repeating: 0, count: N)
var N2 = [Int](repeating: 0, count: N)
var S = [Int](repeating: 0, count: N + 2)
S[N] = 1
S[N + 1] = 0

var m = 0

for n in 0 ..< N {
    let isStepBroken = m < M && a[m] == n
    if isStepBroken {
        N1[n] = N + 1
        N2[n] = N + 1
        m += 1
    } else {
        N1[n] = n + 1
        N2[n] = n + 2
    }
}
for n in (0 ..< N).reversed() {
    S[n] = (S[N1[n]] + S[N2[n]]) % 1_000_000_007
}
let answer = S[0]

print(answer)
