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

ans :: [Int] -> Int -> Int
ans _ 0 = 1
ans [] 1 = 1
ans [a] 1 = if a == 1 then 0 else 1
ans am n
  | n `elem` take n am = 0
  | otherwise = ans (dropWhile (>= n) am) (n-1) + ans (dropWhile (>= n-1) am) (n-2)

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