import Control.Applicative ((<$>)) main :: IO () main = solve <$> readLn >>= print solve :: Integer -> Integer solve n = let m = n `div` 2 in (m * n + n - m ^ 2) `mod` 1000007