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

ans :: [Int] -> Int -> Int
ans am n = (\(a,b,c) -> a) $ foldl func (0,1,1) (am ++ [n+1]) where
  func (a,b,k) l
    | k == l = (b,0,k+1)
    | otherwise = func (b,(a+b) `mod` (10^9+7),k+1) l

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