function factorization1(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
}

let MOD = 10**9+7

function combination(n, r)
{
    if (r === 0 || r === n)
        return 1;
    else if (r == 1)
        return n;
    return (combination(n - 1, r - 1) + combination(n - 1, r))%MOD;
}
function main(arg) {
    let [N, M] = arg.split(" ").map(Number)
    let factors = factorization1(M)
    let ans = 1
    Object.keys(factors).forEach(f=>{
        let a = factors[f].e+N-1
        let b = factors[f].e
        ans *= combination(a, b)
        ans%=MOD
    })
    console.log(ans)
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
