program ccc

implicit none
integer(16) :: n, m, i, j, k, st
integer(16) :: one, two, thr, x, y, z, co, rs
integer(16),allocatable,dimension(:) :: a

read*, n, m
allocate(a(m+2))
do i=2,m+1
read*, a(i)
end do
a(1)=-1
a(m+2)=n+1
rs=1

do i=1,m+1
st=a(i+1)-a(i)-2
if(st<0) then
rs=0
exit
end if
co=0
do j=0,st/2
 one=st-2*j
 two=j
 thr=one+two
 x=1
 y=1
 z=1
  do k=1, one
  x=x*k
  end do
  do k=1,two
  y=y*k
  end do
  do k=1,thr
  z=z*k
  end do
  co=co+z/(x*y)
 end do
 rs=mod((rs*co),1000000007)
end do
if(rs<0) rs=rs+1000000007
write(*,'(i0)') rs
end program