program kadai
implicit none
integer  ::  n,j,m,i
integer,allocatable  ::  a(:)
integer,allocatable  ::  ans(:)

read(*,*) n,m
if (m>1) then
    allocate(a(m))
end if
if (m<2) then
    allocate(a(2))
end if
allocate(ans(n))
a=0
ans=0

do i=1,m
    read(*,*) a(i)
end do

if (m==0) then
    a=0
end if

if(m==1) then
 a(2)=0
end if
j=1
if (a(1)==1 .and. a(2)/=1 ) then
    ans(1)=0
    ans(2)=1
    j=j+1
end if

if (a(1)==1 .and. a(2)==1 ) then
    ans(1)=0
    ans(2)=0
    j=j+2
end if

if (a(1)==2) then
    ans(1)=1
    ans(2)=0
    j=j+1
end if

if (a(1)/=1 .and. a(1)/=2) then
    ans(1)=1
    ans(2)=2
end if

!write(*,*) ans(1)
!write(*,*) ans(2)

if (n>2) then
    do i=3,n
        if(j<m+1 .and. i==a(j)) then
            ans(i)=0
            j=j+1
        else
            ans(i)=mod(ans(i-2)+ans(i-1),1000000007)
        end if
    !write(*,*) ans(i)
    end do
end if

write(*,*) ans(n)

end program kadai
