import Control.Monad
import Data.List

main = do
    [n,m] <- map read . words <$> getLine :: IO [Int]
    as <- map read <$>replicateM m getLine :: IO [Int]
    print $ (\(i,x,y) -> mod x 1000000007) $ last $ take (n+1) $ iterate (\(i,x,y) -> if elem i as then ((i+1),0,x) else ((i+1),(x+y),x) ) (1,1,0)
