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
 
// cache
let DP = Array.init (N+1) (fun _ -> -1)
Array.set DP 0 1
Array.set DP 1 (if As.[0] = 1 then 0 else 1)
 
// 制限のあるフィボナッチ列の計算のようなもの
let rec ans n =
  match n with
  | 0 -> DP.[0]
  | 1 -> DP.[1]
  | n ->
      if DP.[n] <> -1 
      then DP.[n]
      else if Array.contains n As
      then Array.set DP n 0
           0
      else let x = ((ans (n-1)) + (ans (n-2))) % 1000000007
           Array.set DP n x
           x
 
printfn "%d" (ans N)