open List 
(* 1行読み込みする関数 *)
(* i_inp : 1行読み込んで整数に変換, f_inp, s_inpもある *)
let inp : unit -> string = fun () -> 
	input_line stdin
let s_inp = inp
let i_inp : unit -> int = fun () ->
	int_of_string (inp ())
let f_inp : unit -> float = fun () ->
	float_of_string (inp ())
 
(* 1行読み込んで、空白で分割する関数 *)
let inp_list : unit -> string list = fun () ->
	Str.split (Str.regexp " ") (inp ())
let s_inp_list : unit -> string list = inp_list
let i_inp_list : unit -> int list = fun () ->
	map (fun x -> int_of_string x) (inp_list ())
let f_inp_list : unit -> float list = fun () ->
  map (fun x -> float_of_string x) (inp_list ())

(* n行読み込む関数 *)
let rec inp_loop : (unit -> 'a) -> int -> 'a list = fun inp_fun n ->
  if n = 0 then []
  else
    let x = inp_fun () in
    x :: inp_loop inp_fun (n - 1)

      
(* 関数本体 *)
let () =
  let [n; m] = i_inp_list () in
  let brokens = Array.make (n + 1) false in
  let rec inp_loop m =
    if m = 0 then ()
    else
      let x = i_inp () in
      (brokens.(x) <- true;
       inp_loop (m - 1)) in
  let () = inp_loop m in
  let memo = Array.make (n + 1) None in
  let rec loop a =
    match memo.(a) with
      None ->
       if brokens.(a) then 0
       else
         if a + 2 <= n then
           let x = (loop (a + 1) + loop (a + 2)) mod 1000000007 in
           memo.(a) <- Some x;
           x
         else if a + 1 <= n then
           let x = (loop (a + 1)) mod 1000000007 in
           memo.(a) <- Some x;
          x
         else
           (memo.(a) <- Some 1;
            1)
    | Some x -> x
  in
  print_int (loop 0);
  print_newline ()
