import qualified Data.Array.ST as A
import qualified Control.Monad.ST as A
import Control.Monad
import Data.Maybe

main :: IO ()
main = do
    n <- read <$> getLine :: IO Int
    print $ foldr (\a b -> a |* b) 1 [1 + sum [powerInv i p|i<-[1..n]]|p<-primeNumbers n]

powerInv :: Int -> Int -> Int
powerInv n m
    | mod n m == 0 = 1 + powerInv (div n m) m
    | otherwise    = 0

fact :: Int -> Int
fact 0 = 1
fact n = n |* fact (n|-1)

modN :: Int
modN = 10^9+7
 
(|+) :: Int -> Int -> Int
(|+) n m = (`mod` modN) $ n + m 

(|-) :: Int -> Int -> Int
(|-) n m = (`mod` modN) $ n - m 

(|*) :: Int -> Int -> Int
(|*) n m = (`mod` modN) $ (n `mod` modN) * (m `mod` modN) 

(|^) :: Int -> Int -> Int
(|^) x n
  | n == 0    = 1
  | even n    = mod (x*x) modN |^ div n 2
  | otherwise = (`mod` modN) $ (x |^ (n - 1)) * x

(|/) :: Int -> Int -> Int
(|/) n m = n |* (m |^ (modN - 2))

primeNumbers :: Int -> [Int]
primeNumbers n = A.runST (do
    ns <- A.newArray_ (2, n) :: A.ST s (A.STUArray s Int Bool)
    forM_ [2..n] $ \i -> A.writeArray ns i True
    forM_ [2..n] $ \i -> do
        b <- A.readArray ns i
        when b . forM_ [l|l<-[2..n], l*i<=n] $ 
            \l -> A.writeArray ns (i*l) False
    catMaybes <$> (forM [2..n] $ \i -> do
        b <- A.readArray ns i
        return $ if b then Just i else Nothing))