import Control.Monad
 
import Data.Ord
import Data.List
import Data.Function
import Data.Maybe
 
import qualified Data.ByteString.Char8 as BS
 
import Debug.Trace
 
tuplify2 :: [a] -> (a, a)
tuplify2 (x:y:_) = (x, y)
tuplify2 _ = undefined
 
readInt = read :: String -> Integer
readIntTuple = tuplify2 . map readInt . words
readIntList = map readInt . words
 
getInt = readInt <$> getLine
getIntList = readIntList <$> getLine
getIntMatrix = map readIntList . lines <$> getContents
getIntTuple = readIntTuple <$> getLine
getIntTuples = map readIntTuple . lines <$> getContents
 
main = do
  [n,m] <- getIntList
  as <- concat <$> getIntMatrix
  let guard = n+1
  print $ f n 1 1 0 (sort (guard:as))

-- maxN段目への移動方法の組み合わせ数を求める
-- maxN: 最終段の段数
-- n: 現在の段数
-- prevCombo: n-1段目への移動方法
-- prevPrevCombo: n-2段目への移動方法
-- as : 壊れている段 (sorted)
-- 0段目への移動方法: 1通り
-- -1段目への移動方法: 0通り
f maxN n prevCombo prevPrevCombo as@(a:as')
  | n == maxN = (prevCombo + prevPrevCombo) `mod` 1000000007
  | n == a    = f maxN (n+1) 0 prevCombo as'
  | otherwise = f maxN (n+1) newCombo prevCombo as
  where newCombo = (prevCombo + prevPrevCombo) `mod` 1000000007