import Foundation

let MOD = 1000000007

func primeFactorExponents(n: Int) -> [Int] {
    var array: [Int] = []
    var factor = 0
    var factorCount = 0
    var q = n
    if n == 1 {
        return [1]
    }
    var i = 2
    while i*i<=n {
        if q % i == 0 {
            if i != factor {
                factor = i
                factorCount = 1
            } else {
                factorCount += 1
            }
            q /= i
        } else {
            if factor > 0 {
                array.append(factorCount)
                factor = 0
            }
            i += 1
        }
    }
    if q > 1 {
        array.append(1)
    }
    return array
}


let arr = readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
let N = arr[0]
let M = arr[1]

var ans = 1
let exponents = primeFactorExponents(M)
let MAXSIZE = exponents.maxElement()! + N

var fac = [Int](count: MAXSIZE, repeatedValue: 0)
var finv = [Int](count: MAXSIZE, repeatedValue: 0)
var inv = [Int](count: MAXSIZE, repeatedValue: 0)


// テーブルを作る前処理
func COMinit() {
    fac[0] = 1
    fac[1] = 1
    finv[0] = 1
    finv[1] = 1
    inv[1] = 1
    var i = 2
    while i < MAXSIZE {
        fac[i] = fac[i - 1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD
        i += 1
    }
}

// 二項係数計算
func COM(n: Int, _ k: Int) -> Int {
    if n < k {
        return 0
    }
    if n < 0 || k < 0 {
        return 0
    }
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD
}

COMinit()

for e in exponents {
    let c = COM(e+N-1,N-1)
    ans *= c
    ans %= MOD
}

print(ans)
