//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

map< int64_t, LL > prime_factor(int64_t n) {
	map< int64_t, LL > ret;

	for (int64_t i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			ret[i]++;
			n /= i;
		}
	}

	//素数は1回も割られないのでそのままでてくる
	if (n != 1) ret[n] = 1;
	return ret;
}

//for (auto p : prime_factor(N)) {
//	cout << p.first << " " << p.second << endl;
//}

//auto primes=primefactor(n);


template< int mod >
struct Combination
{
	vector< int64_t > mfact, rfact;

	Combination(int sz) : mfact(sz + 1), rfact(sz + 1)
	{
		mfact[0] = 1;
		for (int i = 1; i < mfact.size(); i++) {
			mfact[i] = mfact[i - 1] * i % mod;
		}
		rfact[sz] = inv(mfact[sz]);
		for (int i = sz - 1; i >= 0; i--) {
			rfact[i] = rfact[i + 1] * (i + 1) % mod;
		}
	}

	int64_t fact(int k) const
	{
		return (mfact[k]);
	}

	int64_t pow(int64_t x, int64_t n) const
	{
		int64_t ret = 1;
		while (n > 0) {
			if (n & 1) (ret *= x) %= mod;
			(x *= x) %= mod;
			n >>= 1;
		}
		return (ret);
	}

	int64_t inv(int64_t x) const
	{
		return (pow(x, mod - 2));
	}

	int64_t P(int n, int r) const
	{
		if (r < 0 || n < r) return (0);
		return (mfact[n] * rfact[n - r] % mod);
	}

	int64_t C(int p, int q) const
	{
		if (q < 0 || p < q) return (0);
		return (mfact[p] * rfact[q] % mod * rfact[p - q] % mod);
	}

	int64_t H(int n, int r) const
	{
		if (n < 0 || r < 0) return (0);
		return (r == 0 ? 1 : C(n + r - 1, r));
	}
};

map<LL, LL> enumprimenum(LL n) {
	map<LL, LL> ret;
	for (LL i = 2; i*i <= n; i++) {
		while (n%i == 0) {
			ret[i]++;
			n /= i;
		}
	}
	//素数なら1度も割られずにでてくるのでnのまま。
	if (n != 1)ret[n] = 1;
	return ret;
}

LL modpow(LL a, LL n) {
	LL ret = 1;
	while (n)ret = ret * ((n % 2) ? a : 1) % MOD, a = a * a%MOD, n >>= 1;
	return ret;
}

LL comb(int P, int Q) {
	if (P < 0 || Q<0 || Q>P)return 0;
	LL p = 1, q = 1;
	Q = min(Q, P - Q);
	for (int i = 1; i <= Q; i++)p = p * P%MOD, q = q * i%MOD, P--;
	return p * modpow(q, MOD - 2) % MOD;
}

LL hcomb(int P, int Q) { return (P == 0 && Q == 0) ? 1 : comb(P + Q - 1, Q); }

int main() {

	LL n, m; cin >> n >> m;

	Combination<MOD> com(100010);

	auto p=prime_factor(m);
	//auto p = enumprimenum(m);

	LL ans = 1;

	for (auto i : p) {
		ans = hcomb(n, i.second)*ans%MOD;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1792