#include<bits/stdc++.h>
#define LL long long
#define maxn 201900
#define mod 1000000007
using namespace std;
LL fun[maxn],ans=1;
LL power(LL a,int k)
{
    LL ans=1,y=a;
    while(k)
	{
        if(k%2)
        ans=ans*y%mod;
        
		y=y*y%mod,k=k/2;
    }
    return ans;
}
int main()
{
    long long n,m;
    scanf("%lld%lld",&n,&m);
    fun[0]=1;
    for(int i=1;i<maxn;i++)
	fun[i]=fun[i-1]*i%mod;
    
    for(int i=2;i*i<=m;i++)
	{
        if(m%i==0)
		{
            long long s=0;
            while(m%i==0) 
			{
                m=m/i;
                s++;
            }
            ans=ans*fun[n+s-1]%mod*power(fun[n-1],mod-2)%mod*power(fun[s],mod-2)%mod;
        }
    }
    if(m>1)
    ans=ans*n%mod;
    printf("%lld\n",ans);
    
    return 0;
}