#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
const ll MOD=1000000007;
ll MUL(ll x, ll y) { return x * y % MOD; }
ll POW(ll x, ll e) {
  ll v = 1;
  for (; e; x = MUL(x, x), e >>= 1)
    if (e & 1) v = MUL(v, x);
  return v;
}
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/
  return MUL(x, POW(y, MOD - 2));
}
ll comb(ll n, ll k) { ll v=1; for(ll i=1; i<=k; i++) v = DIV(MUL(v, n-i+1),i); return v; }

map<int, int> prime_factorization(ll M){
  map<int, int> table;
  for (int i=2;i*i<=M;++i){
    while(M%i==0){
      ++table[i];
      M/=i;
    }
  }
  if(M!=1) table[M]=1;
  return table;
}

int main(){
  int N;cin>>N;ll M;cin>>M;
  map<int, int> prime_table=prime_factorization(M);
  ll ans=1;
  for (auto p:prime_table){
    int x=p.second;
    (ans*=comb(N+x-1, x))%=MOD;
  }
  cout << ans << endl;
  return 0;
}