import Control.Monad
import Data.Array.ST
import Data.Array

main :: IO ()
main = do
  [n,m] <- map (read :: String -> Int) . words <$> getLine
  am <- map (read :: String -> Int) <$> getNLine_ m
  print $ ans n am ! n

ans :: Int -> [Int] -> Array Int Integer
ans n am = runSTArray $ do
  ary <- newArray (0,n) 1
  sequence_ [do
    writeArray ary i 0
    | i <- am]
  sequence_ [do
    a <- readArray ary (i-2)
    b <- readArray ary (i-1)
    c <- readArray ary i
    when (c /= 0) $ writeArray ary i ((a+b) `mod` (10^9+7))
    | i <- [2..n]]
  return ary

getNLine_ :: Int -> IO [String]
getNLine_ n = replicateM n getLine
