#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
#define ll unsigned long long
#define Pair pair<ll,ll>

const ll mod = 1e9+7;

ll N, M;

ll C[100050][35]={1};


void solve(){
	ll Ans=1;
	vector<Pair> ans;
	ll m=sqrt(M)+1;

	//cout << m << endl;

	ll count;
	for(ll i=2;i<m;i++){
		count=0;
		while(M%i == 0){
			M /= i; count++;
		}
		if(count != 0) ans.push_back({i,count});
	}
	if(M > 1) ans.push_back({M,1});

	// for(int i=0; i<ans.size();i++){
	// 	cout << ans[i].first << ", " << ans[i].second << endl;
	// }



	for(int i=0; i<ans.size();i++){
		Ans *= C[N-1+ans[i].second][ans[i].second];
		Ans %= mod;

	}

	cout << Ans << endl;





}

int main(){
	cin >> N >> M;

	for(int i=1; i<=N+30; i++) {
		C[i][0] = 1;
		for(int j=1; j<=min(i,30); j++) C[i][j] = (C[i-1][j-1] + C[i-1][j]) % mod;
	}

	solve();
	return 0;
}