open Printf
open Scanf

let (n,m) = sscanf (read_line ()) "%d %d" (fun x y -> (x,y));;
let hash = Hashtbl.create m;;
let _ =
for i = 0 to m-1 do
  let num = sscanf (read_line ()) "%d" (fun x -> x) in
  Hashtbl.add hash num true
done;;

let mm = 1000000007;;

let rec fib n pre =
if n = 1 then (1,1)
else
  if (Hashtbl.mem hash n) then
    if pre = false then (0,0)
    else
      let (i,j) = fib (n-1) false in
     (*
      let _ = printf ("fib = %d\n") n in
      let _ = printf ("obstacl: i = %d j = %d\n") 0 i in
      *)
      (0, i mod mm)
  else
  let (i,j) = fib (n-1) true in
(*  let _ = printf ("fib = %d\n") n in
  let _ = printf ("i = %d j = %d\n") (i+j) i in
  *)
  ((i+j) mod mm, i mod mm)
;;

let (ans,_) = (fib n true) in
printf "%d\n" ans;;