#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;

#ifdef TESTING
  #include "dump.hpp"
#else
  #define DUMP(...)
  #define DEBUG(...)
#endif

typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
#define SZ(a) int((a).size())
#define _REP(_1,_2,_3,_4,name,...) name
#define _REP4(i,b,e,s) for(decltype(e) _b=(b),_e=(e),i=_b+(0<(s)?0:(s));(0<(s)?i<_e:_e<=i);i+=(s))
#define _REP3(i,b,e) for(decltype(e) _b=(b),_e=(e),i=(_b<_e?_b:_b-1);(_b<_e?i<_e:_e<=i);(_b<_e?i++:i--))
#define _REP2(i,n) for(decltype(n) i=0,_n=(n);i<_n;i++)
#define _REP1(n) for(decltype(n) _i=0,_n=(n);_i<_n;_i++)
#define REP(...) _REP(__VA_ARGS__,_REP4,_REP3,_REP2,_REP1)(__VA_ARGS__)
#define FOR(it,c) for(auto&& it=begin(c);it!=end(c);it++)
#define ROF(it,c) for(auto&& it=rbegin(c);it!=rend(c);it++)
#define EB emplace_back
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define INT(n) int n;assert(0<scanf("%d",&n))
#define AI(a,size,n) array<int,size> a;REP(i,n){assert(0<scanf("%d",&a[i]));}
#define VI(v,n) vector<int> v(n);REP(i,n){assert(0<scanf("%d",&v[i]));}

static const int MAXP = 100000;
vector<int> ps, fs;
bool isprime(const long long& n){
  if (n <= MAXP){
    return (1 < n && fs[n] == n);
  } else {
    for(int p: ps){
      if (n % p == 0){return false;}
    }
    return true;
  }
}
vector<pair<long long, int>> factor(long long n){
  vector<pair<long long, int>> v;
  long long i = n;
  if (MAXP < i){
    for(int p: ps){
      int r = 0;
      while (i % p == 0){r++; i /= p;}
      if (0 < r){v.push_back(make_pair(p, r));}
      if (i <= MAXP){break;}
    }
    if (MAXP < i){
      v.push_back(make_pair(i, 1));
      i = 1;
    }
  }
  while(1 < i){
    if (v.empty() || (*v.rbegin()).first != fs[i]){
      v.push_back(make_pair(fs[i], 1));
    } else {
      (*v.rbegin()).second++;
    }
    i /= fs[i];
  }
  return v;
}

int extgcd(int a, int b, int& x, int& y){
  int d = a;
  if (b == 0){
    x = 1; y = 0;
  } else {
    d = extgcd(b, a % b, y, x);
    y -= (a / b) * x;
  }
  return d;
}

const int MOD = 1000000007;

unsigned int modpow(const unsigned int n, unsigned int r){
  if (r == 0){return 1;}
  unsigned long long rtn =  modpow(n, r / 2);
  rtn *= rtn;
  if (r % 2 == 1){rtn *= n;}
  return rtn;
};
unsigned int modinv(unsigned int rem){
  int x, y;
  assert(extgcd((int) rem, (int) MOD, x, y) == 1);
  return (x + MOD) % MOD;
};
unsigned int modadd() { return 0;}
template<typename Head, typename... Tail> unsigned int modadd(const Head& head, const Tail&... tail) { return (head + modadd(tail...)) % MOD; }
template<typename Head, typename... Tail> unsigned int modsub(const Head& head, const Tail&... tail) { return (head + MOD - modadd(tail...)) % MOD; }
unsigned int modmul() { return 1;}
template<typename Head, typename... Tail> unsigned int modmul(const Head& head, const Tail&... tail) { return ((unsigned long long)head * modmul(tail...)) % MOD; }
template<typename Head, typename... Tail> unsigned int moddiv(const Head& head, const Tail&... tail) { return modmul(head, modinv((unsigned int)(modmul(tail...))));
}

static const unsigned int MAXF = 100100;
unsigned int f0[1 + MAXF], f1[1 + MAXF];

void init(){
  fs.reserve(1 + MAXP);
  for(int i = 0; i <= MAXP; i++){fs.push_back(i);}
  for(int i = 2; i <= MAXP; i++){
    if (fs[i] == i){
      ps.push_back(i);
      for (int j = i; j <= MAXP; j += i){
        fs[j] = min(fs[j], i);
      }
    }
  }
  f0[0] = 1;
  for(unsigned int i = 1; i <= MAXF; i++){f0[i] = modmul(i, f0[i - 1]);}
  f1[MAXF] = modinv(f0[MAXF]);
  for(unsigned int i = MAXF; 0 < i; i--){f1[i - 1] = modmul(i, f1[i]);}
}
unsigned int modf(unsigned int n){
  return f0[n];
}
unsigned int modp(unsigned int n, unsigned int r){
  return modmul(f0[n], f1[n - r]);
}
unsigned int modc(unsigned int n, unsigned int r){
  return modmul(f0[n], f1[n - r], f1[r]);
}


int main(){
  init();
  int ans = 1;
  INT(n); INT(m);
  auto f = factor(m);
  for (auto pr: f){
    int p = pr.first, r = pr.second;
    ans = modmul(ans, modc(n + r - 1, r));
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 1536