program main
  implicit none
  integer(8) N,M,loc,a,ans,i
  read(*, *) N,M
  loc = 0
  ans = 1
  do i = 1,M
    read(*, *) a 
    ans = mod(ans*fibonacci(a-loc),1000000007)
    loc = a+1
  end do
  write(* ,*) mod(ans*fibonacci(N-loc+1),1000000007)

  stop
contains


  integer(8) function fibonacci(n)
    implicit none
    integer(8) xn, xn1, xn2, n, i
    if (n == 0) then
      xn = 0
    else if (n == 1) then
      xn = 1
    else
      xn2 = 0
      xn1 = 1
      do i = 2,n
        xn = xn1 + xn2
        xn2 = xn1
        xn1 = xn
      end do
    end if
    fibonacci = xn
    return
  end function fibonacci
  
end program main
