program typical
implicit none
integer n, m, i, j
integer blast, clast, res
integer,allocatable,dimension(:) :: a, b
integer,dimension(:) :: c(100000)
read*, n, m
allocate(a(m))
allocate(b(m))
read*, a
b(1)=a(1)
blast=n-a(m)
 do i=2,m
 b(i)=a(i)-a(i-1)
 end do
 b(1)=10
 if (minval(b).eq.1) then
 print*, 0
 return
 end if
b(1)=a(1)

c(1)=1
c(2)=1
res=1

 do i=1,m
  do j=3,b(i)
  c(j)=c(j-1)+c(j-2)
  end do
  res=mod(res*c(b(i)),1000000007)
 end do

if (blast.ge.3) then
  do i=3,blast
  c(i)=c(i-1)+c(i-2)
  end do
  res=mod(res*c(blast),1000000007)
end if
 print*, res
end program