integer(16) function fib(n)
 implicit none
 integer(16) first,secon,n,i
 first=1
 secon=1
 fib=1
 do i=3,n
  fib = mod(first+secon,1000000007)
  first=secon
  secon=fib
 end do
 return
end function fib

program main
 implicit none
 
 integer(16) N,M,i,pat,fib
 integer(16), allocatable::a(:)
 
 read(*,*)N,M
 pat=1
 if(M==0) then
  pat=0
 else
  allocate(a(1:M))
  read(*,*)a
 end if
 
 do i=1,M-1
  if(a(i+1)-a(i)==1) then
   pat=0
   exit
  end if
 end do
 
 if(pat==1)then
  pat=fib(a(1))
  do i=2,M
   pat = mod(pat*fib(a(i)-a(i-1)-1),1000000007)
  end do
  pat=mod(pat*fib(N-a(M)),1000000007)
 end if
 write(*,*) pat
end program main