const val MOD = (1e9 + 7).toLong()

var fact = Array(200001) { 1L }
var finv = Array(200001) { 1L }

fun comb(n: Int, k: Int): Long {
    if (n < k || k < 0) return 0L
    return fact[n] * finv[n - k] % MOD * finv[k] % MOD
}

fun pow(x: Long, n: Long): Long {
    if (n == 0L) return 1L
    var res = pow(x * x % MOD, n / 2)
    if (n % 2 == 1L) res = res * x % MOD
    return res
}

fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(" ").map { it.toInt() }

    for (i in 1..200000) {
        fact[i] = fact[i - 1] * i % MOD
    }
    for (i in 1..200000) {
        finv[i] = pow(fact[i], MOD - 2)
    }

    var rem = m
    var ans = 1L
    for (i in 2..Math.sqrt(m.toDouble()).toInt()) {
        var cnt = 0
        while (rem % i == 0) {
            cnt++
            rem /= i
        }
        ans = ans * comb(cnt + n - 1, cnt) % MOD
    }
    if (rem != 1) ans = ans * comb(n, 1) % MOD

    println(ans)
}