program a
  implicit none
  integer :: N,i,M
  integer,allocatable :: W(:),st(:),bro(:)

  read(*,*) N,M
  allocate(W(N))
  W=1
  allocate(bro(M))
  allocate(st(N))
 
  if(M.gt.0) then
 	 read(*,*) bro 
     do i=1,M
          W(bro(i))=0
     enddo
  endif
  do i=1,N
     if(i.eq.1) then
        st(i)=W(1)
     elseif(i.eq.2) then
        st(i)=W(2)*(W(1)+1)
     else
        st(i)=mod((st(i-2)+st(i-1)),1000000007)*W(i)
     endif
  enddo

  write(*,'(i0)') st(n)

                                                                    
  deallocate(st)
  deallocate(W)
end program a
