#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  int p=1000000007;
  map<int,int> pf;
  int mf=1;
  for(int64_t i=2;i*i<=m;i++){
    while(m%i==0){
      m/=i;
      pf[i]++;
      mf=max(mf,pf[i]);
    }
  }
  if(m!=1)
    pf[m]++;
  vector<int64_t> f(n+mf+1,1);
  for(int i=1;i<=n+mf;i++)
    f.at(i)=f.at(i-1)*i%p;
  int q=p-2;
  vector<bool> b;
  while(q>0){
    b.push_back(q%2);
    q/=2;
  }
  vector<int64_t> fi(n+mf+1,1);
  for(int i=b.size()-1;i>=0;i--){
    fi.at(n+mf)=fi.at(n+mf)*fi.at(n+mf)%p;
    if(b.at(i))
      fi.at(n+mf)=fi.at(n+mf)*f.at(n+mf)%p;
  }
  for(int i=n+mf;i>=1;i--)
    fi.at(i-1)=fi.at(i)*i%p;
  int c=1;
  for(auto x:pf)
    c=c*f.at(n-1+x.second)%p*fi.at(n-1)%p*fi.at(x.second)%p;
  cout<<c<<endl;
}