
type ABC(stream:System.IO.TextReader) =
  member this.Scan1 f = stream.ReadLine() |> f
  member this.Scan2 f1 f2 = stream.ReadLine().Split() |> (fun a -> (f1 a.[0], f2 a.[1]))
  member this.Scan3 f1 f2 f3 = stream.ReadLine().Split() |> (fun a -> (f1 a.[0], f2 a.[1], f3 a.[2]))
  member this.Scan4 f1 f2 f3 f4 = stream.ReadLine().Split() |> (fun a -> (f1 a.[0], f2 a.[1], f3 a.[2], f4 a.[3]))
  member this.ScanVecH f = stream.ReadLine().Split() |> Array.map f
  member this.ScanVecV n f = [| for i in 1..n -> stream.ReadLine() |> f |]
  member this.ScanMatrix n f  = [ for i in 1..n do yield stream.ReadLine().Split() |> Array.map f ]
  member this.ScanCharMatrix n = [ for i in 1..n -> stream.ReadLine().ToCharArray() ]
  member this.Close () = stream.Close()

let util = ABC(stdin)

let N,M = util.Scan2 int int
let As = util.ScanVecV M int

// DP構築：制限のあるフィボナッチ列の計算のようなもの
let DP = Array.init (N+1) (fun _ -> -1)
Array.set DP 0 1
Array.set DP 1 (if Array.contains 1 As then 0 else 1)

let mutable tmp1 = DP.[0]
let mutable tmp2 = DP.[1]
for n in 2..N do
  if Array.contains n As
  then
    Array.set DP n 0
    tmp1 <- tmp2
    tmp2 <- 0
  else 
    let x = (tmp1 + tmp2) % 1000000007
    Array.set DP n x 
    tmp1 <- tmp2
    tmp2 <- x

printfn "%d" DP.[N]
