#include <iostream>
#include <vector>
using namespace std;

#define Q 1000000007

// CombはMOD計算がしやすいように二項係数で求める
int comb(int n, int k){
  vector<vector<int>> tbl(n+1, vector<int>(k+1));
    
  for (int i=0; i<=n; i++){
    tbl[i][0] = 1;
    if (i<=k) tbl[i][i] = 1;
  }
  for (int i=1; i<=n; i++){
    for (int j=1; j<=k; j++){
      tbl[i][j] = tbl[i-1][j]+tbl[i-1][j-1];
      tbl[i][j] %= Q;
    }
  }
  return tbl[n][k];
}

int main(void){
  int n,m;
  long long ans;
  cin >> n >> m;
  
  ans = 1;
  for (int d=2; m>1; d++){
    int p=0;
    while (m%d==0){
      m /= d;
      p++;
    }
//    cout << d << " " << p << endl;
    if (p){
      ans *= comb(n-1+p, p);
      ans %= Q;
    }
  }
  cout << ans << endl;
  return 0;
}