using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static string InputPattern = "InputX";
static List<string> GetInputList()
{
var WillReturn = new List<string>();
if (InputPattern == "Input1") {
WillReturn.Add("2 6");
//4
}
else if (InputPattern == "Input2") {
WillReturn.Add("3 12");
//18
}
else if (InputPattern == "Input3") {
WillReturn.Add("100000 1000000000");
//957870001
}
else {
string wkStr;
while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
}
return WillReturn;
}
const long Hou = 1000000007;
static void Main()
{
List<string> InputList = GetInputList();
long[] wkArr = InputList[0].Split(' ').Select(pX => long.Parse(pX)).ToArray();
long N = wkArr[0];
long M = wkArr[1];
//Mを素因数分解する
Dictionary<long, long> SoinsuuDict = DeriveSoinsuuDict(M);
long Answer = 1;
foreach (var EachPair in SoinsuuDict) {
// 重複組み合わせの場合の数を求める
long CurrPattern = DeriveChoose(EachPair.Value + N - 1, N - 1);
// 積の法則により掛け算する
Answer *= CurrPattern;
Answer %= Hou;
}
Console.WriteLine(Answer);
}
// nCr (mod Hou)を求める
static long DeriveChoose(long pN, long pR)
{
if (pN < pR) return 0;
pR = Math.Min(pR, pN - pR);
long WillReturn = 1;
for (long I = pN - pR + 1; I <= pN; I++) {
WillReturn *= I;
WillReturn %= Hou;
}
for (long I = 2; I <= pR; I++) {
WillReturn *= DeriveGyakugen(I);
WillReturn %= Hou;
}
return WillReturn;
}
// 素因数分解し、指数[素数]なDictを返す
static Dictionary<long, long> DeriveSoinsuuDict(long pTarget)
{
var WillReturn = new Dictionary<long, long>();
long CurrVal = pTarget;
// ルートより大きい数を、素因素に持つとしても、1つだけのため
// ルートまで試し割りを行い、素因数が残っていたら、追加する
for (long I = 2; I * I <= pTarget; I++) {
if (CurrVal % I > 0) continue;
WillReturn[I] = 0;
while (CurrVal % I == 0) {
WillReturn[I]++;
CurrVal /= I;
}
if (CurrVal == 1) break;
}
// 素因数が残っている場合
if (CurrVal > 1) {
WillReturn[CurrVal] = 1;
}
return WillReturn;
}
//引数の逆元を求める
static long DeriveGyakugen(long pLong)
{
return DeriveBekijyou(pLong, Hou - 2, Hou);
}
//繰り返し2乗法で、(NのP乗) Mod Mを求める
static long DeriveBekijyou(long pN, long pP, long pM)
{
long CurrJyousuu = pN % pM;
long CurrShisuu = 1;
long WillReturn = 1;
while (true) {
//対象ビットが立っている場合
if ((pP & CurrShisuu) > 0) {
WillReturn = (WillReturn * CurrJyousuu) % pM;
}
CurrShisuu *= 2;
if (CurrShisuu > pP) return WillReturn;
CurrJyousuu = (CurrJyousuu * CurrJyousuu) % pM;
}
}
}