#include <bits/stdc++.h>
const int MOD=1000000007;
const int INF=1000000000;
using namespace std;
typedef long long ll;
typedef tuple<ll,ll,ll> tup;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> P;
ll n,m,combs[100100][55];
vector<ll> primes;
int pows[100100];
ll ans=1;
ll combsinit(ll num)
{
  memset(combs,0,sizeof(combs));
  combs[0][0]=1;
  for(ll i=1;i<=num;i++)
    {
      combs[i][0]=1;
      for(ll j=1;j<=50;j++)
	{
	  combs[i][j]=(combs[i-1][j-1]+combs[i-1][j])%MOD;
	}
    }
  return 0;
}

void Primes(ll num)
{
  for(ll i=2;i*i<=num;i++)
    {
      ll cnt=0;
      while(num%i==0)
	{
	  num/=i;
	  cnt++;
	}
      if(cnt)
	{
	  ans*=combs[n-1+cnt][cnt];
	  ans%=MOD;
	}
    }
  if(num>1)
    {
      ans*=n;
      ans%=MOD;
    }
}

int main(int argc,char const* argv[])
{
  cin >> n >> m;
  combsinit(n+50);
  Primes(m);
  cout << ans << endl;
  return 0;
}

