#include<bits/stdc++.h>

#define LL long long
#define RG register

using namespace std;
template<class T> T gi() {
	T x = 0; bool f = 0; char c = getchar();
	while (c != '-' && (c < '0' || c > '9')) c = getchar();
	if (c == '-') f = 1, c = getchar();
	while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return f ? -x : x;
}
const int N = 1e5 + 10, Mod = 1e9 + 7;
int f[31];
int main() {
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	int n = gi<int>(), m = gi<int>();
	f[0] = 1;
	for (int i = 1; i <= n; i++)
		for (int j = 0; j < 30; j++)
			f[j] = (f[j - 1] + f[j]) % Mod;
	int ans = 1;
	for (int i = 2; m > 1; i++)
		if (m % i == 0) {
			int cnt = 0;
			while (m % i == 0) m /= i, cnt++;
			ans = 1ll * ans * f[cnt] % Mod;
		}
	printf("%d\n", ans);
	return 0;
}
