#include <iostream>
using namespace std;
long long n, m, ans=1, cnt, M=1e9+7, C[100050][35]={1};
int main() {
	int i, j, t;
	cin>>n>>m;
	for(i=1; i<=n+30; i++) {
		C[i][0] = 1;
		for(j=1; j<=min(i,30); j++) C[i][j] = (C[i-1][j-1] + C[i-1][j]) % M;
	}
	t = m;
	for(i=2; i*i<=m; i++) {
		cnt = 0;
		while(t%i==0) cnt++, t /= i;
		if(cnt>0) ans = (ans * C[cnt+n-1][cnt]) % M;
	}
	if(t>1) ans = (ans * n) % M;
	cout<<ans;
	return 0;
}