program main
 implicit none
 integer(16) n,m,i
 integer(16), allocatable :: a(:),pat(:)
 
 read(*,*) n,m
 if(m==0)then
  allocate(pat(1:n+2))
 else
  allocate(a(1:m),pat(1:n+2))
  read(*,*) a
 end if
 
 do i=1,n+2
  pat(i)=0
 end do
 
 if(m==0)then
  pat(1)=1
  do i=1,n
   pat(i+1)=pat(i+1)+pat(i)
   pat(i+2)=pat(i+2)+pat(i)
  end do
 else
  pat(a(1)+1)=-1
  do i=2,m
   if(a(i)==a(i-1)+1)then
    write(*,*) 0
    stop
   end if
   pat(a(i)+1) = -1
  end do
  
  pat(1)=1
  do i=1,n
   if(pat(i)/=-1)then
    if(pat(i+1)/=-1)then
     pat(i+1)=mod(pat(i+1)+pat(i),1000000007)
    end if
    if(pat(i+2)/=-1)then
     pat(i+2)=mod(pat(i+2)+pat(i),1000000007)
    end if
   end if
  end do
 end if
 
 write(*,*) pat(n+1)
end program main