import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

moduloN = 10 ^ 9 + 7
modN = flip mod moduloN
mulMod x y = modN $ x * y

main = do
    [n, m] <- getIntList
    as <- replicateM m getInt
    print . foldl' mulMod 1 $ zipWith (\x y -> modN (mf (x - y - 2))) (as ++ [n+1]) ((-1) : as)
    
mf x | x < 0 = 0
     | otherwise =
           let f 0 = 1
               f 1 = 1
               f n = mf (n - 2) + mf (n - 1)
           in (map f [0..]) !! x