{-# LANGUAGE ScopedTypeVariables #-}
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import qualified Data.ByteString.Char8 as BS
import Control.Monad
import Control.Monad.ST
import Control.Applicative
import Data.Maybe

m :: Int
m = 10^9+7

solve :: VUM.IOVector Bool -> VUM.IOVector Int -> Int -> IO Int
solve oks dp n = do  
  forM_ [0..n-1] $ \i ->
    forM_ [i+1..min n (i+2)] $ \j -> do
      judge <- VUM.read oks j
      when judge $ do
        now <- VUM.read dp i
        next <- VUM.read dp j
        VUM.write dp j ((now+next) `mod` m)
  VUM.read dp n

main = do
  [n, m] <- map read . words <$> getLine :: IO [Int]
  (oks :: VUM.IOVector Bool) <- VUM.replicate (n+1) True
  forM_ [1..m] $ \_ -> do
    x <- BS.getLine
    let Just (i,_) = BS.readInt x
    VUM.write oks i False
  
  (dp :: VUM.IOVector Int) <- VUM.replicate (n+1) 0
  VUM.write dp 0 1
  solve oks dp n >>= print