#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

const int N=5e6+15;
const ll mo=1e9+7;
ll n,m,tot;
ll s[N],fac[N];
void div(ll x)
{
	for (int i=2;1ll*i*i<=x;i++)
	{
		if (x%i) continue;
		++tot;
		while (x%i==0) x/=i,s[tot]++;
	}
	if (x>1)
	{
		s[++tot]=1;
	}
}
ll qpow(ll a,ll b)
{
	ll re=1;
	for (;b;b>>=1,a=a*a%mo) if (b&1) re=re*a%mo;
	return re;
}
ll C(ll a,ll b)
{
	return fac[a]*qpow(fac[b],mo-2)%mo*qpow(fac[a-b],mo-2)%mo;
}
int main()
{
	fac[0]=1;
	for (int i=1;i<N;i++) fac[i]=fac[i-1]*i%mo;
	scanf("%lld%lld",&n,&m);
	div(m);
	ll ans=1;
	for (int i=1;i<=tot;i++)
	{
		ll now=C(s[i]+n-1,n-1);
		ans=ans*now%mo;
	}
	printf("%lld\n",ans);
	return 0;
}