program steps
  implicit none
  integer :: n, m, i, maxstep, ans
  integer,allocatable :: a(:), b(:), fib(:)

  read *, n, m
  allocate(a(m+2),b(m+1))
  a(1) = -1
  do i = 1, m
    read *, a(i+1)
  end do
  a(m+2) = n+1
  do i = 1, m+1
    b(i) = a(i+1) - a(i) - 2
  end do
  maxstep = maxval(b)
  allocate(fib(maxstep+1))
  fib(1) = 1
  fib(2) = 1
  do i = 3, maxstep+1
    fib(i) = mod(fib(i-1)+fib(i-2),1000000007)
  end do
  ans = 1
  do i = 1, m+1
    ans = mod(ans * fib(b(i)+1),1000000007)
  end do
  print '(i0)', ans
end program steps
