#include<bits/stdc++.h>
using namespace std;
int64_t mod=1e9+7;
int64_t pw(int64_t x,int64_t y){
  int z;
  if(y==0) return 1;
  else{
    z=pw(x,y/2)*pw(x,y/2)%mod;
    if(y%2==1) z=z*x%mod;
    return z;
  }
}
int64_t comb(int64_t x,int64_t y){
  int64_t z=1,i;
  for(i=1;i<=y;i++){
    z=z*(x-i+1)%mod;
    z=z*pw(i,mod-2)%mod;
  }
  return z;
}
int main(){
  int64_t n,m,k,l,i,ans=1;
  cin>>n>>m;
  vector<int64_t> x;
  k=m;
  for(i=2;i*i<=m;i++){
    l=0;
    while(k%i==0){
      k/=i;
      l++;
    }
    if(l>0) x.push_back(l);
  }
  if(k>1) x.push_back(1);
  for(auto z:x) ans=ans*comb(n+z-1,z)%mod;
  cout<<ans<<endl;
}