import qualified Data.ByteString.Char8 as BS
import Control.Monad
import Data.Char
import Data.List

getVals::IO [Int]
getVals = unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

main::IO()
main = do
    s:_ <- getVals
    print $ solver s

modnum::Int
modnum = 10^9 + 7

mSum::Int->Int->Int
mSum a b = mod (a+b) modnum

genPascal::[[Int]]
genPascal = [1]:[map (\ (a,b)-> mSum a b)(zip (0:prevStep)(prevStep++[0]))|prevStep<-genPascal]


solver::Int -> Int
solver s = foldl mSum 0 [genPascal !! (s-(3*i)+(i-1)) !! (i-1) | i<-[1.. div s 3]] 