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

  read(*,*) N,M
  allocate(W(N))
  W=1
  allocate(bro(M))
  allocate(st(N))
     read(*,*) bro
  if(M.gt.0) then
     do i=1,M
!        write(*,*) bro(i),i                                                             
          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)=W(i)*(st(i-2)+st(i-1))
     endif
  enddo

  write(*,'(i0)') mod(st(N),1000000007)


!  deallocate(bro)                                                                       
  deallocate(st)
  deallocate(W)
end program a


