#include<bits/stdc++.h>
#define MOD 1000000007
#define MX 32
using namespace std;

int n, m, c;
long long f1[MX+1], f2[MX+1], t = 1, ans = 1;

int main(){
  scanf("%d%d", &n, &m);
  f1[0] = 1;
  for(int i = 1; i <= MX; i++){
    t = t * i % MOD;
    f1[i] = f1[i-1] * (n-1+i) % MOD;
  }
  f2[MX] = 1;
  for(int i = MOD-2; i; i/=2){
    if(i&1) f2[MX] = f2[MX] * t % MOD;
    t = t*t % MOD;
  }
  for(int i = MX; i >= 1; i--){
    f2[i-1] = f2[i] * i % MOD;
    f1[i] = f1[i] * f2[i] % MOD;
  }
  for(int i = 2; i*i <= m; i+=2){
    for(c = 0; m%i == 0; c++, m/=i);
    if(c) ans = ans * f1[c] % MOD;
    if(i == 2) i--;
  }
  if(m-1) ans = ans * f1[1] % MOD;
  
  printf("%lld", ans);
}
