#include<iostream>
using namespace std;
long mod=1e9+7,ans=1,fac[1<<17],n,m;
long power(long a,long b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}
int main()
{
	cin>>n>>m;
	fac[0]=1;
	for(long i=1;i<1<<17;i++)fac[i]=fac[i-1]*i%mod;
	for(int i=2;i*i<=m;i++)
	{
		if(m%i==0)
		{
			long p=0;
			while(m%i==0)m/=i,p++;
			ans=ans*fac[n+p-1]%mod*power(fac[n-1],mod-2)%mod*power(fac[p],mod-2)%mod;
		}
	}
	if(m>1)
	{
		ans=ans*n%mod;
	}
	cout<<ans<<endl;
}