program ccc

implicit none

integer(8) :: n, m, i
integer(8),allocatable,dimension(:) :: a, b, dp

read*, n, m
allocate(a(m))
allocate(dp(0:n))
allocate(b(0:n))
read*, a

dp=0
b=0

do i=1,m
b(a(i))=1
end do

if     (b(1)/=0.and.b(2)/=0) then
write(*,'(i0)') 0 
return
else if(b(1)/=0.and.b(2)==0) then
dp(1)=0
dp(2)=1
else if(b(1)==0.and.b(2)/=0) then
dp(1)=1
dp(2)=0
else if(b(1)==0.and.b(2)==0) then
dp(1)=1
dp(2)=2
end if

if(n==2) then
write(*,'(i0)') dp(2)
return

do i=3,n
dp(i)=dp(i-2)+dp(i-1)
if(b(i)/=0) dp(i)=0
end do

write(*,'(i0)') mod(dp(n),1000000007)

end program