#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<functional>
#include<vector>
#include<map>

using namespace std;
#define endl '\n'
#define pb push_back
#define fst first
#define scd second
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define REP(i,n) for(int i = 0;i < (n);i++)
#define FOR(i,a,b) for(int i = (a);i <= (b);i++)
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl

constexpr int MOD = 1000000007;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vector<int>> vii;

template <class T = int> T in() { T x; cin >> x; return (x); }
template <class T = int> void out(T x) { cout << (x) << endl; }

int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }

constexpr int MAX = 1e6;

class Modulo {
private:
	long long num;
	long long mod;

public:
	Modulo(long long _mod) :
		num(0),
		mod(_mod)
	{

	}

	Modulo(long long _num, long long _mod) :
		num(_num),
		mod(_mod)
	{
		num %= mod;
		num += mod;
		num %= mod;
	}

	Modulo(const Modulo &o) :
		num(o.num),
		mod(o.mod)
	{
	}

	// 表示
	long long get_num() {
		return num;
	}

	// MODのリセット
	void reset_mod(long long _mod) {
		mod = _mod;
		num %= mod;
	}

	// 演算子オーバーロード

	// =
	Modulo &operator=(Modulo obj) {
		num = obj.num;
		return *this;
	}

	Modulo &operator=(long long obj) {
		num = obj;
		num %= mod;
		num += mod;
		num %= mod;
		return *this;
	}

	Modulo &operator=(int obj) {
		num = (long long)obj;
		num %= mod;
		num += mod;
		num %= mod;
		return *this;
	}

	// +
	Modulo operator+(Modulo obj) {
		return Modulo((num + obj.num) % mod, mod);
	}
	Modulo operator+(long long obj) {
		obj %= mod;
		obj += mod;
		obj %= mod;
		return Modulo((num + obj) % mod, mod);
	}
	Modulo operator+(int obj) {
		long long new_obj = (long long)obj;
		new_obj %= mod;
		new_obj += mod;
		new_obj %= mod;
		return Modulo((num + new_obj) % mod, mod);
	}

	// -
	Modulo operator-(Modulo obj) {
		long long tmp = num;
		tmp -= obj.num;
		tmp += mod;
		tmp %= mod;
		return Modulo(tmp, mod);
	}
	Modulo operator-(long long obj) {
		long long tmp = num;
		obj %= mod;
		obj += mod;
		obj %= mod;
		num -= obj;
		num += mod;
		num %= mod;
		return Modulo(tmp, mod);
	}
	Modulo operator-(int obj) {
		long long new_obj = (long long)obj;
		long long tmp = num;
		new_obj %= mod;
		new_obj += mod;
		new_obj %= mod;
		tmp -= new_obj;
		tmp += mod;
		tmp %= mod;
		return Modulo(tmp, mod);
	}

	// *
	Modulo operator*(Modulo obj) {
		long long tmp = num;
		tmp *= obj.num;
		tmp %= mod;
		return Modulo(tmp, mod);
	}
	Modulo operator*(long long obj) {
		long long tmp = num;
		tmp *= obj;
		tmp %= mod;
		return Modulo(tmp, mod);
	}
	Modulo operator*(int obj) {
		long long tmp = num;
		long long new_obj = (long long)obj;
		tmp *= new_obj;
		tmp %= mod;
		return Modulo(tmp, mod);
	}

	// /
	Modulo operator/(Modulo obj) {
		long long tmp = num;
		tmp *= mod_inv(obj.num);
		tmp %= mod;
		return Modulo(tmp, mod);
	}
	Modulo operator/(long long obj) {
		long long tmp = num;
		tmp *= mod_inv(obj);
		tmp %= mod;
		return Modulo(tmp, mod);
	}
	Modulo operator/(int obj) {
		long long tmp = num;
		tmp *= mod_inv((long long)obj);
		tmp %= mod;
		return Modulo(tmp, mod);
	}

	// +=
	Modulo &operator+=(Modulo obj) {
		num += obj.num;
		num %= mod;
		return *this;
	}
	Modulo &operator+=(long long obj) {
		obj %= mod;
		obj += mod;
		obj %= mod;
		num += obj;
		num %= mod;
		return *this;
	}
	Modulo &operator+=(int obj) {
		long long new_obj = (long long)obj;
		new_obj %= mod;
		new_obj += mod;
		new_obj %= mod;
		num += new_obj;
		num %= mod;
		return *this;
	}

	// -=
	Modulo &operator-=(Modulo obj) {
		num -= obj.num;
		num += mod;
		num %= mod;
		return *this;
	}
	Modulo &operator-=(long long obj) {
		obj %= mod;
		obj += mod;
		obj %= mod;
		num -= obj;
		num += mod;
		num %= mod;
		return *this;
	}
	Modulo &operator-=(int obj) {
		long long new_obj = (long long)obj;
		new_obj %= mod;
		new_obj += mod;
		new_obj %= mod;
		num -= new_obj;
		num += mod;
		num %= mod;
		return *this;
	}

	// *=
	Modulo &operator*=(Modulo obj) {
		num *= obj.num;
		num %= mod;
		return *this;
	}
	Modulo &operator*=(long long obj) {
		num *= obj;
		num %= mod;
		return *this;
	}
	Modulo &operator*=(int obj) {
		long long new_obj = (long long)obj;
		num *= new_obj;
		num %= mod;
		return *this;
	}

	// /=
	Modulo &operator/=(Modulo obj) {
		num *= mod_inv(obj.num);
		num %= mod;
		return *this;
	}
	Modulo &operator/=(long long obj) {
		num *= mod_inv(obj);
		num %= mod;
		return *this;
	}
	Modulo &operator/=(int obj) {
		long long new_obj = (long long)obj;
		num *= mod_inv(new_obj);
		num %= mod;
		return *this;
	}

	// ==
	bool operator==(Modulo obj) {
		return num == obj.num && mod == obj.mod;
	}

	// 逆元を求める
	long long mod_inv(long long value) {

		long long b = mod, u = 1, v = 0;

		while (b) {
			long long t = value / b;
			value -= t * b;
			swap(value, b);
			u -= t * v;
			swap(u, v);
		}
		u %= mod;
		if (u < 0) u += mod;

		return u;
	}

	// a^n の計算

	Modulo mod_pow(long long n) {
		long long a = num;
		long long res = 1;
		while (n > 0) {
			if (n & 1) res = res * a % mod;
			a = a * a % mod;
			n >>= 1;
		}
		return Modulo(res, mod);
	}

};

ll fac[MAX], finv[MAX], inv[MAX];

void mk_mod_comb() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

ll comb(ll n, ll r) {
	if (n < r) return 0;
	if (n < 0 || r < 0) return 0;
	return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD;
}

ll f(ll cnt, ll N) {
	return comb(cnt + N - 1, N - 1) % MOD;
}

void solve() {

	mk_mod_comb();

	ll N, M;

	cin >> N >> M;

	Modulo ans(1, MOD);

	for (ll i = 2; i <= M; i++) {
		ll cnt = 0;
		while (M % i == 0) {
			cnt++;
			M /= i;
		}
		ans *= Modulo(f(cnt, N), MOD);
	}

	out(ans.get_num());

	return;

}

int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);

	solve();

	return 0;

}


Measured memory_bytes: 23680