#include<bits/stdc++.h>
using namespace std;
map<int, int> divider;

static const int mod = 1e9 + 7;

long long modPow(long long a, long long b){
  if(b == 0) return 1;
  
  if(b & 0b1) return a*modPow(a, b-1) % mod;

  return modPow(a*a % mod, b/2) % mod;
}


long long modComb(long long a, int b){
  if(a-b < b) return modComb(a, a-b);

  long long A = a, B = 1;
  long long As = 1, Bs = 1;
  for(int i = b; i > 0; --i){
    As = As * A % mod;
    Bs = Bs * B % mod;
    --A;
    ++B;
  }

  return As * modPow(Bs, 1e9+7-2) % mod;
}


signed main(){
  int n, m;

  cin >> n >> m;

  for(int i=2; i*i <= m; ){
    if(m % i == 0){
      m /= i;
      ++divider[i];
    }else ++i;
  }
  if(m != 1) ++divider[m];

  long long ans = 1;
  for(auto x : divider){
    ans = ans * modComb(n-1 + x.second, x.second) % mod;
  }

  cout << ans << endl;
}


