fun main(args : Array<String>) {
    val (N, M) = readLine()!!.split(" ").map { it.toLong() }
    val fact = primeFactor(M.toInt())
    val MOD = 1000000000+7L
    var ans = 1L
    fact.entries.forEach {
        // N 個
        ans = ans * nCk(it.value + (N-1), N-1, MOD) % MOD
    }
    println(ans)
}


// O(N^0.5)
// O(√n)
fun primeFactor(n: Int) : Map<Int, Int> {
    val map = mutableMapOf<Int, Int>()
    var num = n;
    for (i in 2..(Math.sqrt(n.toDouble())).toInt()) {
        // iで割れるところまで割り続ける
        while (num % i == 0) {
            if (map[i] == null) {
                map[i] = 1
            } else {
                map[i] = 1 + map[i]!!
            }
            num /= i;
        }
    }
    // 残りが1じゃなかったらそれもカウントする
    if (num != 1) map[num] = 1

    return map
}
/*
fun primeFactor(N: Long) : Map<Long, Long> {
    val map = hashMapOf<Long, Long>();
    var num = N
    (2..(Math.sqrt(N.toDouble()).toLong())).forEach {
        var count = 0L
        while (num % it == 0L) {
            num /= it
            count++
        }
        map[it] = count
    }

    if (num != 1L) {
        map[num] = 1
    }

    return map
}
*/

fun pow(a: Long, b: Long, M: Long): Long {
    var b = b
    var ret: Long = 1
    var tmp = a
    while (b > 0) {
        if (b and 1 == 1L) ret = ret * tmp % M
        tmp = tmp * tmp % M
        b = b shr 1
    }
    return ret
}
fun nCk(n: Long, k: Long, M: Long): Long {
    var ret: Long = 1
    val min = Math.min(k, n - k)
    for (i in 1..min) {
        ret = ret * pow(i, (M - 2), M) % M
    }
    for (i in n - min + 1..n) {
        ret = ret * i % M
    }
    return ret
}