#include <iostream>
using namespace std;
#define int long long

int powmod(int a, int n, int mod) {
	if (n == 0) return 1;
	if (n % 2) return (a * powmod(a, n - 1, mod)) % mod;
	return powmod((a * a) % mod, n / 2, mod);
}

int mod = 1000000007;
int fact[200001];
int factInv[200001];

void initFact() {
	fact[0] = 1;
	factInv[0] = 1;
	for (int i = 1; i < 200001; i++) {
		fact[i] = (i * fact[i - 1]) % mod;
		factInv[i] = powmod(fact[i], mod - 2, mod);
	}
}

int comb(int n, int k) {
	return fact[n] * factInv[k] % mod * factInv[n - k] % mod;
}

int n, m;

signed main() {
	cin >> n >> m;
	initFact();
	
	int i, t = m, ans = 1;
	for (i = 2; i * i <= t; i++) {
		int cnt = 0;
		while (t % i == 0) {
			t /= i;
			cnt++;
		}
		ans *= comb(cnt + n - 1, n - 1);
		ans %= mod;
	}
	if (t > 1) {
		ans *= comb(n, n - 1);
		ans %= mod;
	}
	
	cout << ans << endl;
	return 0;
}