Problem:
Score : 400 points

Problem Statement

You are given positive integers N and M.

How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7.

Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.

Constraints

All values in input are integers.

1 \leq N \leq 10^5

1 \leq M \leq 10^9

Input

Input is given from Standard Input in the following format:

N M

Output

Print the number of the sequences consisting of positive integers that satisfy the condition, modulo 10^9 + 7.

Sample Input 1

2 6

Sample Output 1

4

Four sequences satisfy the condition: \{a_1, a_2\} = \{1, 6\}, \{2, 3\}, \{3, 2\} and \{6, 1\}.

Sample Input 2

3 12

Sample Output 2

18

Sample Input 3

100000 1000000000

Sample Output 3

957870001

Solution in JavaScript (Node.js 12.16.1) (judge verdict: Wrong Answer)

const MOD = 10**9+7
const N = 10**5+100

let fac = [...new Array(N)].fill(0)
let ifac = [...new Array(N)].fill(0)

const factorization = (n) => {
    let primes= []
    for(let i=2; i*i<=n; i++) {
        let exponent = 0
        while(n%i===0) {
            n /= i
            exponent++
        }
        if(exponent) {
            primes.push({p:i, e:exponent})
        }
    }
    
    if(n!==1) {
        primes.push({p:n, e:1})
    }
    return primes
}


const mpow = (x, n) => {
    ans = BigInt(1);
    let _x = BigInt(x)
    while(n != 0){
        if(n & 1) ans = ans*_x % BigInt(MOD);
        _x = _x*_x % BigInt(MOD);
        n = n >> 1;
    }
    return Number(ans);
}

const comb = (n, r) => {
    if(n == 0 && r == 0) return 1;
    if(n < r || n < 0) return 0;
    const tmp = (BigInt(ifac[n-r]) * BigInt(ifac[r])) % BigInt(MOD);
    return Number((tmp * BigInt(fac[n])) % BigInt(MOD))
}

const init = () => {
    fac[0] = 1;
    ifac[0] = 1;
    for(let i=0; i<N; i++){
        fac[i+1] = fac[i]*(i+1) % MOD; // n!(mod M)
        ifac[i+1] = mpow(fac[i+1], MOD - 2) % MOD
    }
}

const main = (arg) => {
    let [N, M] = arg.split(" ").map(Number)
    let factors = factorization(M)
    let ans = 1
    init()

    Object.keys(factors).forEach(f=>{
        let a = factors[f].e+N-1
        let b = factors[f].e
        ans *= comb(a, b)
        ans %= MOD
    })
    console.log(ans)
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));