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



read(*,*) n,m
allocate(a(m))
allocate(ans(n))
a=0
ans=0

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

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)>2) then
    ans(1)=1
    ans(2)=2
end if

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

do i=3,n
    if(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

write(*,*) ans(n)

end program kadai