import qualified Data.ByteString.Char8 as BC
import Data.Maybe
import Control.Monad.ST
import Data.Array.Unboxed
import Data.Array.ST

readIntLines :: IO [Int]
readIntLines = map (fst . fromJust . BC.readInt) . BC.lines <$> BC.getContents

solve :: Int -> [Int] -> Int
solve n as = runSTUArray func ! n
  where
    func = do
      arr <- newArray (0, 10000) 0 :: ST s (STUArray s Int Int)
      mapM_ (iter arr) [0..10000]
      return arr
    iter a 0 = writeArray a 0 1
    iter a 1 = writeArray a 1 1
    iter a i = do
      v1 <- readArray a (i - 2)
      v2 <- readArray a (i - 1)
      let r1 = if (i - 2) `elem` as then 0 else v1
      let r2 = if (i - 1) `elem` as then 0 else v2
      writeArray a i $ (r1 + r2) `mod` 1000000007

main :: IO ()
main = do
  [n, m] <- map read . words <$> getLine
  as <- readIntLines
  print $ solve n as