Problem:


Score : 300 points

Problem Statement

You are given an integer N.
Find the number of the positive divisors of N!, modulo 10^9+7.

Constraints

1≤N≤10^3

Input

The input is given from Standard Input in the following format:

N

Output

Print the number of the positive divisors of N!, modulo 10^9+7.

Sample Input 1

3

Sample Output 1

4

There are four divisors of 3! =6: 1, 2, 3 and 6. Thus, the output should be 4.

Sample Input 2

6

Sample Output 2

30

Sample Input 3

1000

Sample Output 3

972926972



Sample input:
3


Sample output:
4

Submission status: Wrong Answer

Solution code:
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())


def era(n):
    data = [i for i in range(2, n + 1)]
    for d in data:
        data = [x for x in data if (x == d or x % d != 0)]
    data1 = []
    for d in data:
        data1.append([d, 1])
    return data1


n = ni()
lis = era(n)
for i in range(1, n + 1):
    for j in range(len(lis)):
        if i < lis[j][0]:
            break
        elif i % lis[j][0] == 0:
            lis[j][1] += 1
ans = 1
for i in range(len(lis)):
    ans *= lis[j][1]
print(ans)

Submission status: Wrong Answer

Solution code:
from math import factorial
n=factorial(int(input()))
cnt=0
for i in range(2,n):
    if n%i==0:
        cnt+=1
print((cnt+2)%(10**9+7))

Submission status: Wrong Answer

Solution code:
from math import factorial
n=factorial(int(input()))
cnt=0
for i in range(2,n):
    if n%i==0:
        cnt+=1
print(cnt+2)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict as dd
primes = dd(int)
n = int(input())
for i in range(2,n+1):
  for j in range(2,int(i**.5)+1):
    while i%j == 0:
      i //= j
      primes[i] += 1
    if i > 1:
      primes[i] += 1
cnt = 1
mod = 10**9+7
for x in primes:
  cnt *= primes[x]+1
  cnt %= mod
print(cnt)

Submission status: Wrong Answer

Solution code:
import operator as o
import functools as f
n=int(input())
l=[]
for s in range(1,n+1):
    count=0
    for t in range(1,s+1):
        if s%t==0:
            count+=1
    l.append(count)
print(f.reduce(o.mul,l))

Submission status: Wrong Answer

Solution code:
import math
N = math.factorial(int(input()))
i = 2
ans = 1
M = 10**9+7
while i**2 <= N:
  cnt=1
  while N%i == 0:
    cnt+=1
    N = N//i
    ans = ans*cnt
    i += 1
if N != 1 :
  ans = 2
print(ans%M)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 3:
    print(1)
    exit()

primes = [2]

import math
for i in range(3, n+1):
    k = int(math.sqrt(i))
    flag = True
    for p in primes:
        if p > k:
            break
        if  i%p == 0:
            flag = False
            break
    if flag:
        primes.append(i)

ans = 1
for p in primes:
    k = n
    cnt = 0
    while k:
        k = k//p
        cnt += k
    # print(p, cnt)
    ans *= cnt + 1
ans = ans % (10**9 + 7)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 3:
    print(1)
    exit()

primes = [2]

import math
for i in range(3, n+1):
    k = int(math.sqrt(i))
    flag = True
    for p in primes:
        if p > k:
            break
        if not i % p:
            flag = False
            break
    if flag:
        primes.append(i)

ans = 1
for p in primes:
    k = n
    cnt = 0
    while k:
        k = k//p
        cnt += k
    # print(p, cnt)
    ans *= cnt + 1
    ans = ans % (10**9 + 7)
print(ans)

Submission status: Wrong Answer

Solution code:
S=int(input());
s=[];
x=[];
X=[];
so=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,107,109,113,127,131,137,139,149,151,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,809,811,821,823,827,829,839,853,857,859,863,877,881,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];
ans=1;
for h in range(S):
    Y=h+1;
    for i in so:
        j=0;
        while Y%i==0:
            Y=Y/i;
            s=s+[i];
            j+=1;
for i in so:
    x=x+[s.count(i)];
X=[X+1 for X in x];
for i in X:
    ans=ans*i;
print(ans%1000000007);

Submission status: Wrong Answer

Solution code:
S=int(input());
s=[];
x=[];
X=[];
so=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,83,89,97,101,107,109,113,127,131,137,139,149,151,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,809,811,821,823,827,829,839,853,857,859,863,877,881,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];
ans=1;
for h in range(S):
    Y=h+1;
    for i in so:
        j=0;
        while Y%i==0:
            Y=Y/i;
            s=s+[i];
            j+=1;
for i in so:
    x=x+[s.count(i)];
X=[X+1 for X in x];
for i in X:
    ans=ans*i;
print(ans%1000000007);

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

count = N
for i in range(2,N):
    kumiawase =  math.factorial(N-1)//(math.factorial(N-i)*math.factorial(i))
    #print(kumiawase)
    count = (count + kumiawase)%(10**9+7)
    #print(count)

print(count)

Submission status: Wrong Answer

Solution code:
import math
from collections import Counter
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()
            
            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

mysum = math.factorial(n)

arr = []
i = 2

while i < mysum:
    
    if mysum % i == 0:
        
        arr.append(i)
        
        mysum = mysum // i
        
    else:
        
        i+=1
        
else:
        
    arr.append(i)

list01=Counter(arr)

cnt=1
for k in list01:
    
    cnt *=list01[k]+1
    
print(cnt % (10 **9 +7))

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
mod = 10**9 + 7
prime = [True for i in range(n + 1)]

res = 1
for i in range(2, n + 1):
	if prime[i]:
		curr = i * i
		while curr <= n:
			prime[curr] = False
			curr += i

		curr = i
		exponent = 0

		while curr <= n:
			exponent += n / curr
			curr *= curr

		res *= (exponent + 1)
		res %= mod

print res

Submission status: Wrong Answer

Solution code:
n = int(raw_input())

prime = [True for i in range(n + 1)]

res = 1
for i in range(2, n + 1):
	if prime[i]:
		curr = i * i
		while curr <= n:
			prime[curr] = False
			curr += i

		curr = i
		exponent = 0

		while curr <= n:
			exponent += n / curr
			curr *= curr

		res *= (exponent + 1)

print res

Submission status: Wrong Answer

Solution code:
import math
N = int(input())

Box = []
for i in range(N):
    Box.append( math.factorial(N) / (math.factorial(N - i) * math.factorial(i)  )   )
print(sum(Box) % 100000007)

Submission status: Wrong Answer

Solution code:
import math
n = int(input().strip())
print(math.factorial(n) % (10**9 + 7))

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
denom = 10**9+7

prime_counter = {}

def factorize(x):
    for i in range(2, int(N**0.5)+1):
        while (x%i == 0):
            if i not in prime_counter:
                prime_counter[i] = 1
            else:
                prime_counter[i] += 1
            x = x//i
    if x != 1:
        if x not in prime_counter:
            prime_counter[x] = 1
        else:
            prime_counter[x] += 1

for i in range(2,N+1):
    factorize(i)

order_list = list(prime_counter.values())
order_list = [i+1 for i in order_list]
print(np.prod(order_list)%denom)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())

prime_counter = {}

def factorize(x):
    for i in range(2, int(N**0.5)+1):
        while (x%i == 0):
            if i not in prime_counter:
                prime_counter[i] = 1
            else:
                prime_counter[i] += 1
            x = x//i
    if x != 1:
        if x not in prime_counter:
            prime_counter[x] = 1
        else:
            prime_counter[x] += 1

for i in range(2,N+1):
    factorize(i)

order_list = list(prime_counter.values())
order_list = [i+1 for i in order_list]
print(np.prod(order_list))

Submission status: Wrong Answer

Solution code:
primes = [2,3,5,7,11,13,17,19,23,29,31]

memo1 = {}
def factorization(n):
    result = []
    for prime in primes:
        while n % prime == 0:
            n = n / prime
            result.append(prime)
    if n != 1:
        result.append(n)
    return result

def num_of_factors(l):
    if l == []:
        return 1
    if len(l) == 1:
        return 2
    p2num = {}
    for prime in l:
        if prime not in p2num:
            p2num[prime] = 2
        else:
            p2num[prime] += 1
    return reduce(lambda x,y: x * y,p2num.values())

def factors_of_factorials(n):
    l = []
    for i in range(1,n+1):
        l += factorization(i)
    return num_of_factors(l) % (10**9 + 7)


n = int(raw_input())
print n,factors_of_factorials(n)

Submission status: Wrong Answer

Solution code:
primes = [2,3,5,7,11,13,17,19,23,29,31]

memo1 = {}
def factorization(n):
    result = []
    for prime in primes:
        while n % prime == 0:
            n = n / prime
            result.append(prime)
    if n != 1:
        result.append(n)
    return result

def num_of_factors(l):
    if len(l) == 1:
        return 2
    p2num = {}
    for prime in l:
        if prime not in p2num:
            p2num[prime] = 2
        else:
            p2num[prime] += 1
    return reduce(lambda x,y: x * y,p2num.values())

def factors_of_factorials(n):
    l = []
    for i in range(1,n+1):
        l += factorization(i)
    return num_of_factors(l) % (10**9 + 7)


n = int(raw_input())
print n,factors_of_factorials(n)

Submission status: Wrong Answer

Solution code:
from collections import Counter
def kaijou(value):
    sum_ = 1
    keep = []
    for v in range(1, value + 1):
        keep.append(count_element(v))

    # tmp = {}
    # for di in keep:
    #     dict(tmp, di)
    tmp = {}
    for di in keep:
        # print (di)
        tmp = Counter(tmp) + Counter(di)
    want = 1
    for i in tmp.values():
        want *= (i + 1)
    return int(want % 1000000007)
    # return tmp

def count_element(value):
    max_value = value
    if value == 0:
        return {}
    min_value = 1
    element_count = 1
    hash_ = {}
    while max_value != 1:
        for v in range(min_value + 1, max_value + 1):
            count = 0
            while max_value % v == 0:
                max_value = int(max_value / v)
                count += 1
            if count == 0:
                continue
            element_count *= count
            # print (element_count)
            min_value = v
            hash_[v] = element_count
            break
    return hash_

if __name__ == "__main__":
    print(kaijou(int(input())))

Submission status: Wrong Answer

Solution code:
from math import factorial

def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(int(i))
        i += 1
    if n > 1:
        table.append(int(n))
    return table

def __main__():
    n = int(input())
    if n == 1:
        print(1)
        return
    i = 2
    prime_factors_count = [0] * 1001
    while i <= n:
        prime_factors = prime_decomposition(i)
        for j in range(prime_factors[-1] + 1):
            c = prime_factors.count(j)
            prime_factors_count[j] += c
        i += 1
    c = 1
    for i in range(1001):
        if prime_factors_count[i] != 0:
            c *= prime_factors_count[i] + 1
    print(c)
    print(c % (10**9 + 7))

__main__()

Submission status: Wrong Answer

Solution code:
# -*- coding: UTF-8 -*-
def prime_t(t):
    i=2
    while i**2<=t:
        if t%i==0:
            return 0
        i+=1
    return 1
p=[]

for i in range(2,1008):
    if prime_t(i):
        p.append(i)
d={i:0 for i in p}
mod=10**9+7
n=int(input())
tmp=1
ans=1
R=[i for i in range(168)]
for i in range(1,n+1):
    tmp*=i
    for j in R:
        while tmp%p[j]==0:
            d[p[j]]+=1
            tmp//=p[j]
        if tmp<p[j]:
            break
for i in d:
    ans*=(d[i]+1)
    ans%=mod

Submission status: Time Limit Exceeded

Solution code:
from math import factorial
n = int(input())
m = factorial(n)
s = 2
ans = 1
while s > 1:
    c = 1
    while m % s == 0:
        c += 1
        m = m // s
    ans *= c
    s += 1
print(ans % (10**9+7))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
import math
num = math.factorial(n)
ans = 0
for i in range(1,num+1):
  if num%i==0:
    ans+=1
print(ans%(10**9+7))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
import math
num = math.factorial(n)
ans = 0
for i in range(1,num+1):
  if num%i==0:
    ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
from math import factorial

N = factorial(int(input()))
i = 2
ans = dict()
n = N
while i*i <= N:
    while n%i ==0:
        n = n//i
        if i in ans:
            ans[i] += 1
        else:
            ans[i] = 1
    i += 1
if n != 1:
    ans[n] = 1

cnt = 1
for value in ans.values():
    cnt *= value + 1
M = 10**9 + 7    
print(cnt%M)

Submission status: Time Limit Exceeded

Solution code:
import math

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
n = math.factorial(n)
ans = make_divisors(n)

print(len(ans)%(10**9+7))

Submission status: Time Limit Exceeded

Solution code:
import math

N = int(input())
mod = 10 ** 9 + 7
fact = math.factorial(N)
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
div = make_divisors(fact)
print(len(div))

Submission status: Time Limit Exceeded

Solution code:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

import math
N = int(input())
l = math.factorial(N)
t = make_divisors(l)
print(len(t)%(10**9+7))

Submission status: Time Limit Exceeded

Solution code:
import math

mod = 10 ** 9 + 7
n = int(input())
f = math.factorial(n)
l = []
i = 1
while i * i <= f:
    if f % i == 0:
        l.append(i)
        if i != f // i:
            l.append(f // i)
    i += 1
print(pow(len(l), 1, mod))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return len(table)

MOD = 1000000007

#階乗を求める
result = 0
count = 0
def kaijouWithMod(n):
    if(n == 1):
        return n
    return n * kaijouWithMod(n - 1)

print(divisor(kaijouWithMod(N)) % MOD)

Submission status: Time Limit Exceeded

Solution code:
import math

N = int(input())

ans=1
x = math.factorial(N)
for i in range(1, x//2+1):
    if x%i == 0:
        ans += 1
print(ans%(10**9+7))

Submission status: Time Limit Exceeded

Solution code:
import math
n=math.factorial(int(input()))
a=i=1
while i*i<=n:
  c=1
  while n%i==0:
    c+=1
    n//=i
  a*=c
  i+=1
print(a*2**(n!=1)%(10**9+7))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
k=1
ans=0
for i in range (n):
    k=k*(i+1)
for j in range(k):
    if k%(j+1)==0:
        ans+=1
print(ans%1000000007)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
d=dict()
for i in range(1,n+1):
  for j in range(1,i+1):
    while i%j==0:
      if j not in d:
        d[j]=1
      else:
        d[j]+=1
      i//=j
ans=1
for i in d.values():
  ans*=i+1
print(ans%1000000007)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
ans=1
d=dict()
for i in range(1,n+1):
  k=1
  for j in range(1,i+1):
    if j==0 or j==i:
      continue
    if i%j==0:
      k=0
  if k:
    d[i]=0
    n0=n
    while n0:
      d[i]+=n0//i
      n0//=i
for i in d.values():
  ans*=i+1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

mysum = math.factorial(n)

cnt = 0

i = mysum

while i >= 1:
    
    if mysum % i == 0:
    
        cnt += 1
        
    i -= 1
    
n = 10 ** 9 + 7    
print(cnt % n)

Submission status: Accepted

Solution code:
from collections import defaultdict
import math

def sieve_of_eratosthenes(n):
    sieve = list(range(n+1))
    m = int(math.sqrt(n))
    for i in range(2, m + 1):
        if sieve[i] < i:
            continue
        for j in range(i * i, n + 1, i):
            if sieve[j] == j:
                sieve[j] = i
    return sieve

def factorize_by_sieve(x, sieve):
    factor = dict()
    while x != 1:
        if sieve[x] in factor:
            factor[sieve[x]] += 1
        else:
            factor[sieve[x]] = 1
        x //= sieve[x]
    return factor

mod = 10 ** 9 + 7
n = int(input())
if n == 1:
    print(1)
    quit()

sieve = sieve_of_eratosthenes(n)
dic = defaultdict(int)
for i in range(2, n+1):
    factor = factorize_by_sieve(i, sieve)
    for p, dim in factor.items():
        dic[p] += dim

ans = 1
for _, dim in dic.items():
    ans = ans * (dim + 1) % mod
print(ans)

Submission status: Accepted

Solution code:
from math import factorial
N = factorial(int(input()))
mod = 10**9 + 7
ans = 1
i = 2

while i*i <= N:
    cnt = 1
    while N%i == 0:
        cnt += 1
        N //= i
    ans *= cnt
    i += 1

if N != 1:
    ans *= 2
print(int(ans%mod))

Submission status: Accepted

Solution code:
N = int(input())
mod = 10 ** 9 + 7
keep = [0 for i in range(N + 1)]


def warizan(i, j, remind):
    cnt = 0
    while i % j == 0:
        i = i // j
        cnt += 1
    return cnt + remind, i


for i in range(1, N + 1):
    for j in range(2, N + 1):
        if i % j == 0:
            keep[j], i = warizan(i, j, keep[j])

ans = 1
for i in keep:
    ans = ans * (i + 1) % mod

print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
from typing import List, Tuple


def pf(n: int) -> List[Tuple[int,int]]:
    r = []
    for p in range(2, n):
        if p * p > n:
            break
        e = 0
        if n % p == 0:
            while(n % p == 0):
                n //= p
                e += 1
            r.append((p, e))
    if n != 1:
        r.append((n, 1))
    return r


d = defaultdict(int)
n = int(input())
for i in range(1,n+1):
    r = pf(i)
    for p,e in r:
        d[p] += e

mod = 10**9+7
ans = 1
for ei in d.values():
    ans *= ei+1
    ans %= mod
print(ans)

Submission status: Accepted

Solution code:
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():

    def prime_factor(n):
        lst = []
        while n%2 == 0:
            n //= 2
            lst.append(2)
        f = 3
        while f**2 <= n:
            if n%f == 0:
                n //= f
                lst.append(f)
            else:
                f += 2
        if n != 1:
            lst.append(n)
        return lst

    n = I()
    ans = 1
    dic = collections.defaultdict(int)
    mod = 10**9 + 7

    for i in range(1,n+1):
        count = collections.Counter(prime_factor(i))
        for k, v in count.items():
            dic[k] += v

        
    for v in dic.values():
        ans *= v+1
        ans %= mod

    print(ans)
        


main()

Submission status: Accepted

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if not arr:
        arr.append([n, 1])

    return arr


N = int(input())
MOD = 10 ** 9 + 7
x = dict()
for i in range(N, 1, -1):
    for f in factorization(i):
        if not f[0] in x:
            x[f[0]] = 1
        x[f[0]] += f[1]
ans = 1
for i in x.values():
    ans *= i
print(ans % MOD)

Submission status: Accepted

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if not arr:
        arr.append([n, 1])

    return arr


N = int(input())
MOD = 10 ** 9 + 7
x = dict()
for i in range(N, 1, -1):
    for f in factorization(i):
        if not f[0] in x:
            x[f[0]] = 1
        x[f[0]] += f[1]
ans = 1
for i in x.values():
    ans = (ans * i) % MOD
print(ans)

Submission status: Accepted

Solution code:
import sys
import collections

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007

#+++++

def main():
	#a = int(input())
	v = [-1]*1001
	v[0]=0
	v[1]=0
	for i in range(2,1000+1):
		if v[i] == -1:
			c=1
			while c * i <= 1000:
				v[c*i] = i
				c+= 1
	
	n = int(input())
	dd=collections.defaultdict(lambda :0)
	for i in range(2, n+1):
		p=i
		while p > 1:
			yakusuu = v[p]
			dd[yakusuu] += 1
			p = p // yakusuu
	
	ret = 1
	for k in dd:
		ret *= dd[k]+1
		ret %= mod
		
	return ret
	
	
	#b , c = tin()
	#s = input()	
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)