fun main(args: Array<String>) {
    val MOD = 1000000007L
    fun modpow(a: Long, p: Int): Long {
        if (p == 0) return 1
        return if (p % 2 == 0) {
            val halfP = p / 2
            val half = modpow(a, halfP)
            half * half % MOD
        } else {
            a * modpow(a, p - 1) % MOD
        }
    }

    fun calcComb(a: Int, b: Int): Long {
        if (b > a - b) return calcComb(a, a - b)
        var ansMul = 1L
        var ansDiv = 1L
        for (n in 0 until b) {
            ansMul *= (a - n).toLong()
            ansDiv *= (n + 1).toLong()
            ansMul %= MOD
            ansDiv %= MOD
        }
        return ansMul * modpow(ansDiv, MOD.toInt() - 2) % MOD
    }
    
    val (N, M) =listOfInt()
    var MNokori = M
    var ans = 1L
    var n = 2
    while (n * n <= MNokori) {
        if (MNokori % n == 0) {
            var cnt = 0
            while (MNokori % n == 0) {
                cnt++
                MNokori /= n
            }
            ans *= calcComb(N + cnt - 1, N - 1)
            ans %= MOD
        }
        n += 1
    }
    if (MNokori != 1) {
        ans *= calcComb(N + 1 - 1, N - 1)
        ans %= MOD
    }
    println(ans)
}
fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) }
fun listOfLong() = listOfString().map { java.lang.Long.parseLong(it) }

