import Data.List

main = do
    n <- readLn
    let ps = takeWhile (<=n) primes
        fs = map (succ . (f n)) ps
    print $ foldl' (\a b -> (a * b) `mod` (10^9+7)) 1 fs

primes = 2 : 3 : [x | i <- [1..], j <- [-1, 1], let x = 6 * i + j, isPrime x]
    where isPrime n = null [i | i <- takeWhile (\x -> x * x <= n) primes, rem n i == 0]

f n p = sum . map (n `div`) . takeWhile (<= n) $ map (p^) [1..]