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