{-# OPTIONS_GHC -O2 #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE BangPatterns #-}
import Control.Monad
import Data.Maybe
import qualified Data.Set as S
import qualified Data.Map as Map
import qualified Data.ByteString.Char8 as BS

-- DP
-- {{{
type Memo a b = Map.Map a b
type DP a b = a -> State (Memo a b) b

dp :: Ord a => DP a b -> DP a b
dp f x = do
  memo <- gets (Map.lookup x)
  case memo of
       Just y  -> return y
       Nothing -> do
         y <- f x
         modify (Map.insert x y)
         return y

evalDP :: DP a b -> a -> b
evalDP f x = evalState (f x) Map.empty

evalDPAll :: DP a b -> [a] -> [b]
evalDPAll f xs = evalState (sequence (map f xs)) Map.empty

-- State
newtype State s x = State { runState :: s -> (x, s) }

instance Functor (State s) where
    fmap = liftM

instance Applicative (State s) where
    pure x = State $ \s -> (x, s)
    (<*>) = ap

instance Monad (State s) where
    m >>= k = State $ \s ->
        let (x, s0) = runState m s
        in runState (k x) s0

get :: (State s) s
get = State $ \s -> (s, s)

put :: s -> (State s) ()
put s = State $ \_ -> ((), s)

state :: (s -> (a, s)) -> (State s) a
state f = do
    s <- get
    let (a, s') = f s
    put s'
    return a

modify :: (s -> s) -> (State s) ()
modify f = get >>= put . f

gets :: (s -> a) -> (State s) a
gets f = get >>= return . f

evalState = (fst .) . runState
execState = (snd .) . runState
-- }}}

-- Input functions with ByteString
-- {{{
tuplify2 (x:y:_) = (x,y)
tuplify2 _ = undefined

readInt :: Num a => BS.ByteString -> a
readInt = fromIntegral . fst . fromJust . BS.readInteger
readIntTuple :: Num a => BS.ByteString -> (a, a)
readIntTuple = tuplify2 . map readInt . BS.words
readIntList :: Num a => BS.ByteString -> [a]
readIntList = map readInt . BS.words

getInt :: Num a => IO a
getInt = readInt <$> BS.getLine
getIntList :: Num a => IO [a]
getIntList = readIntList <$> BS.getLine
getIntN n = map readInt <$> replicateM (fromIntegral n) BS.getLine
getIntNList n = map readIntList <$> replicateM (fromIntegral n) BS.getLine
getIntMatrix = map readIntList . BS.lines <$> BS.getContents
getIntTuple = readIntTuple <$> BS.getLine
getIntNTuples n = map readIntTuple <$> replicateM (fromIntegral n) BS.getLine
getIntTuples = map readIntTuple . BS.lines <$> BS.getContents
-- }}}

type Info = S.Set Int

main = do
    [n,m] <- getIntList :: IO [Int]
    as <- getIntN m :: IO [Int]
    print $ f n (S.fromList as) 0 `mod` 1000000007

f :: Int -> Info -> Int -> Integer
f !n !d = evalDP (f' n d)

f' :: Int -> Info -> DP Int Integer
f' !n !d = dp $ \i ->
  if i `elem` d || i > n
    then return 0
    else if i == n || i == (n-1)
           then return 1
           else do
            a <- f' n d (i+1)
            b <- f' n d (i+2)
            return (a + b)

