// 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: 4.0952320818953005x):
#include <bits/stdc++.h>



using namespace std;



typedef long long          ll;

typedef unsigned long long ull;

typedef vector<int>	       vi;

typedef vector<bool>       vb;

typedef map<int, int>      mii;

typedef pair<int, int>     ii;



#define INF                0x3f3f3f3f

#define INFLL              0x3f3f3f3f3f3f3f3f

#define each(x, s)         for(auto& x : s)

#define loop(x)	           for(int i = 0;i < x;i++)

#define vloop(v, x)        for(int v = 0;v < x;v++)

#define avg(l, r)          l + (r - l) / 2

#define iter(a)            a.begin(), a.end()

#define riter(a)           a.rbegin(), a.rend()

#define endl               "\n"



const ll mod = 1000000007;



mii fats(int x) {

	mii fs;

	for (int i = 2;i * i <= x;i++) {

		while (x % i == 0) {

			fs[i]++;

			x /= i;

		}

	}

	if (x > 1) fs[x]++;

	return fs;

}



pair<ll, ll> eucl(ll a, ll b) {

	if (b == 0) return make_pair(1ll, 0ll);

	ll x, y;

	tie(x, y) = eucl(b, a % b);

	return make_pair(y, x - a / b * y);

}



ll inv(ll a) {

	ll x;

	tie(x, ignore) = eucl(a, mod);

	return (x % mod + mod) % mod;

}



ll choose(ll n, ll k) {

	k = min(k, n - k);

	ll a = 1, b = 1;

	loop(k) {

		a *= n - i;

		b *= i + 1;

		a %= mod;

		b %= mod;

	}

	return a * inv(b) % mod;

}



int main() {

	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);



	int n, m;

	cin >> n >> m;

	mii fs = fats(m);

	ll ans = 1;

	each(p, fs) {

		ans *= choose(p.second + n - 1, n - 1);

		ans %= mod;

	}

	cout << ans << endl;

	return 0;

}