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

Solution in Python (3.8.2) (judge verdict: Accepted)

def PrimeDecomp(N,ConcFlag):
    if ConcFlag:
        if N<=1:
            return [1],1
        else:
            I = 2
            PrimeDec = []
            DivCount = 1
            while I*I<=N:
                Cnt = 0
                while N%I==0:
                    N //= I
                    PrimeDec.append(I)
                DivCount *= (Cnt+1)
                I += 1
            if N>=2:
                PrimeDec.append(N)
                DivCount *= 2
            return PrimeDec,DivCount        
    else:
        if N<=1:
            return [1],[1],1
        else:
            I = 2
            PrimeDec = []
            PrimeCnt = []
            DivCount = 1
            while I*I<=N:
                Cnt = 0
                while N%I==0:
                    N //= I
                    Cnt += 1
                if Cnt>=1:
                    PrimeDec.append(I)
                    PrimeCnt.append(Cnt)
                    DivCount *= (Cnt+1)
                I += 1
            if N>=2:
                PrimeDec.append(N)
                PrimeCnt.append(1)
                DivCount *= 2
            return PrimeDec,PrimeCnt,DivCount

def DivisorFactorial(N,FactDec,FactCnt,MemoFlag,Mod,ModFlag):
    if MemoFlag:
        if N<=1:
            FDivCnt = 1
            return FactDec,FactCnt,FDivCnt
        else:
            PrimeDec,PrimeCnt,_ = PrimeDecomp(N,False)
            for TP in range(0,len(PrimeDec)):
                if PrimeDec[TP] in set(FactDec):
                    FactCnt[FactDec.index(PrimeDec[TP])] += PrimeCnt[TP]
                else:
                    FactDec.append(PrimeDec[TP])
                    FactCnt.append(PrimeCnt[TP])
            FDivCnt = 1
            for TF in FactCnt:
                FDivCnt = [FDivCnt*(TF+1),(FDivCnt*(TF+1))%Mod][ModFlag]
            return FactDec,FactCnt,FDivCnt
    else:
        if N<=1:
            FDivCnt = 1
            return FactDec,FactCnt,FDivCnt
        else:
            for TN in range(2,N+1): 
                PrimeDec,PrimeCnt,_ = PrimeDecomp(TN,False)
                for TP in range(0,len(PrimeDec)):
                    if PrimeDec[TP] in set(FactDec):
                        FactCnt[FactDec.index(PrimeDec[TP])] += PrimeCnt[TP]
                    else:
                        FactDec.append(PrimeDec[TP])
                        FactCnt.append(PrimeCnt[TP])
            FDivCnt = 1
            for TF in FactCnt:
                FDivCnt = [FDivCnt*(TF+1),(FDivCnt*(TF+1))%Mod][ModFlag]
            return FactDec,FactCnt,FDivCnt
FactDec,FactCnt,FDivCnt = DivisorFactorial(int(input()),[],[],False,10**9+7,True)
print(FDivCnt)