#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rep2(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define rev(i, n) for (int (i) = (n)-1; (i) >= 0; (i)--)
#define rev2(i, a, b) for (int (i) = (a)-1; (i) >= (b); (i)--)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define yn {puts("Yes");}else {puts("No");}
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Pll = pair<long long, long long>;
template<class T> using Vec = vector<T>;
template<class T> using VVec = vector<vector<T>>;
long long TEN(int i) {return !i ? 1 : TEN(i-1)*10LL;}
template<class T, class U> 
bool chmin(T& a, const U& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T, class U> 
bool chmax(T& a, const U& b) {if (a < b) {a = b; return 1;} return 0;}

struct IoSetup {
	IoSetup() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(10);
	}
} iosetup;

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

template<long long mod>
class ModInt {
public:
	long long v;
	ModInt(long long v = 0) : v((v % mod + mod) % mod) {}
	ModInt operator+(ModInt t) {return ModInt((v + t.v) % mod);}
	ModInt operator-(ModInt t) {return ModInt((v - t.v + mod) % mod);}
	ModInt operator*(ModInt t) {return ModInt((v * t.v) % mod);}
	ModInt operator+=(ModInt t) {return *this = *this + t;} 
	ModInt operator-=(ModInt t) {return *this = *this - t;}
	ModInt operator*=(ModInt t) {return *this = *this * t;}
	ModInt operator-() {return ModInt(-v);}
	ModInt mpow(long long t) {
		if (t == 0) return ModInt(1);
		ModInt a = mpow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}
	ModInt inv() {return mpow(mod - 2);}
	ModInt operator/(ModInt t) {return ModInt(v) * t.inv();}
	ModInt operator/=(ModInt t) {return *this = *this / t;}
	ModInt operator==(ModInt t) {return *this.v == t.v;}
	ModInt operator!=(ModInt t) {return *this.v != t.v;}
	friend ostream& operator<<(ostream& os, const ModInt& mi) {return os << mi.v;}
};

using mint = ModInt<1000000007>;

template<const long long mod>
class BinominalCoefficient {
public:
    using mint = ModInt<mod>;

    int MAX;
    vector<mint> fac, inv, finv;
    BinominalCoefficient(int MAX = 2000005) {
        this->MAX = MAX;
        fac = vector<mint>(MAX, 1);
        inv = vector<mint>(MAX, 1);
        finv = vector<mint>(MAX, 1);
        for (int i = 2; i < MAX; ++i) {
            fac[i] = fac[i - 1] * mint(i);
            inv[i] = -inv[mod % i] * mint(mod / i);
            finv[i] = finv[i - 1] * inv[i];
        }
    }
    mint com(int n, int k) {
        if (k > n || n < 0 || k < 0) return 0;
        return fac[n] * finv[k] * finv[n - k];
    }
    mint Okcom(int n, int k) {
        if (k > n || n < 0 || k < 0) return 0;
        mint ans = 1;
        for (int i = 0; i < k; i++) {
            ans *= mint(n - i) * inv[k - i];
        }
        return ans;
    }
};

vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

int N, M;

void solve() {
	BinominalCoefficient<1000000007> bf;
	mint ans = mint(1);
	Vec<Pll> pf = prime_factorize(M);
	rep (i, pf.size()) {
		ans *= bf.com(N - 1 + pf[i].se, N - 1);
	}
	cout << ans << endl;
}

int main() {
	cin >> N >> M;
	solve();
	
	return 0;
}

Measured memory_bytes: 50192