import qualified Data.Vector.Unboxed.Mutable as VUM
import qualified Data.ByteString.Char8 as BS
import Control.Monad
import Control.Monad.ST
import Control.Applicative

m :: Int
m = 10^9+7

solve ngs n = runST $ do  
  dp <- VUM.replicate (n+1) 0
  VUM.write dp 0 1

  forM_ [0..n-1] $ \i ->
    forM_ [i+1..min n (i+2)] $ \j ->
      unless (j `elem` ngs) $ do
        now <- VUM.read dp i
        next <- VUM.read dp j
        VUM.write dp j ((now+next) `mod` m)
  VUM.read dp n

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