// Slower C++ solution:
#include<bits/stdc++.h> //Ithea Myse Valgulious

namespace chtholly{

typedef long long ll;

#define re0 register int

#define rec register char

#define rel register ll

#define gc getchar

#define pc putchar

#define p32 pc(' ')

#define pl puts("")

/*By Citrus*/

inline int read(){

  int x=0,f=1;char c=gc();

  for (;!isdigit(c);c=gc()) f^=c=='-';

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return f?x:-x;

  }

template <typename mitsuha>

inline bool read(mitsuha &x){

  x=0;int f=1;char c=gc();

  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';

  if (!~c) return 0;

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return x=f?x:-x,1;

  }

template <typename mitsuha>

inline int write(mitsuha x){

  if (!x) return 0&pc(48);

  if (x<0) x=-x,pc('-');

  int bit[20],i,p=0;

  for (;x;x/=10) bit[++p]=x%10;

  for (i=p;i;--i) pc(bit[i]+48);

  return 0;

  }

inline char fuhao(){

  char c=gc();

  for (;isspace(c);c=gc());

  return c;

  }

}using namespace chtholly;

using namespace std;

const int yuzu=2e5,mod=1e9+7;

typedef ll fuko[yuzu|10];

fuko cnt,jic={1},inv;



ll kasumi(ll a,ll b=mod-2){

ll s=1;

for (;b;b>>=1,a=a*a%mod) if (b&1) s=s*a%mod;

return s;

}



ll zuhe(int n,int m){

return jic[n]*inv[m]%mod*inv[n-m]%mod;

}



int main(){

int j,n=read(),m=read(),i;

for (i=1;i<=yuzu;++i) jic[i]=jic[i-1]*i%mod;

inv[yuzu]=kasumi(jic[yuzu]);

for (i=yuzu-1;~i;--i) inv[i]=inv[i+1]*(i+1)%mod;

for (i=2;i*i<=m;++i) 

  if (m%i==0) for (++*cnt;m%i==0;cnt[*cnt]++) m/=i;

if (m>1) cnt[++*cnt]++;

ll ans=1;

for (i=1;i<=*cnt;++i) ans=ans*zuhe(cnt[i]+n-1,cnt[i])%mod;

write(ans);

}

// Faster C++ solution for the same problem (measured speedup: 3.521644993544798x):
//把质因数写出来后就是很明显的插板法了 

#include <bits/stdc++.h>

#define Maxn 1000000

#define rint register int

using namespace std;

const int Mod = 1e9 + 7;



int read() {

  rint s = 0, f = 1; register char ch = getchar();

  while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); }

  while (isdigit(ch)) { s = s * 10 + ch - '0'; ch = getchar(); }

  return s * f;

}



namespace Mathscalc {

  inline int add(int a, int b) { return a + b >= Mod ? a + b - Mod : a + b; }

  inline int sub(int a, int b) { return a - b < 0 ? a - b + Mod : a - b; }

  inline int mul(int a, int b) { return 1LL * a * b % Mod; }

  inline int power(int a, int b) { rint res = 1; for (; b; b >>= 1) { if ( b & 1 ) res = mul(res, a); a = mul(a, a); } return res; }

} using namespace Mathscalc;



int n, m;

int c[Maxn], p[Maxn], primenum = 0;

int inv[Maxn], fac[Maxn], invfac[Maxn];



void input() { n = read(), m = read(); }



namespace Solution {

  void divide(int x) {

  	for (rint i = 2; i <= sqrt(x); ++i) {

  		if (x % i == 0) {

  			p[++primenum] = i, c[primenum] = 0;

  			while (x % i == 0) x /= i, ++c[primenum];

			}

		}

		if (x > 1) p[++primenum] = x, c[primenum] = 1;

	}

	

	void get() {

		inv[1] = 1;

		fac[0] = fac[1] = 1;

		invfac[0] = invfac[1] = 1;

		for (rint i = 2; i <= n + 1000; ++i) {

		  inv[i] = mul((Mod - Mod / i), inv[Mod % i]);

			fac[i] = mul(fac[i - 1], i);

			invfac[i] = mul(invfac[i - 1], inv[i]);

		}

	}

	

	inline int C(int n, int m) { return mul(fac[n], mul(invfac[m], invfac[n - m])); }

	

	void solve() {

		divide(m);

		get();

		int ans = 1;

		for (rint i = 1; i <= primenum; ++i) ans = mul(ans, C(n + c[i] - 1, n - 1));

		printf("%d\n", ans);

	}

}



signed main() {

  input();

  Solution :: solve();

  return 0;

}