#include <bits/stdc++.h>
#define err(args...) {}
#ifdef DEBUG
#include "_debug.cpp"
#endif
using namespace std;
using ll = long long;
template <typename signature> using f = const function<signature>&;
template <typename T> void factorize(T n, f<void(T)> each_divisor, f<void(T)> each_prime = [](T) {}) {
    for(T i = 2; i * i <= n; i++) {
        if(n % i == 0) {
            each_prime(i);
            while(n % i == 0) {
                each_divisor(i);
                n /= i;
            }
        }
    }
    if(n > 1) {
        each_divisor(n);
        each_prime(n);
    }
}
#ifndef __MODINT_INCLUDED_
#define __MODINT_INCLUDED_
// WARNING: use with caution; significant constant factor slowdown
const ll M = 1'000'000'007;
struct modint {
    ll val;
    modint() : val(0) {}
    modint(ll val) : val(val) {}
    explicit operator ll() const { return val; }
    bool operator==(const modint& y) const { return val == y.val; }
    bool operator!=(const modint& y) const { return val != y.val; }
    bool operator< (const modint& y) const { return val <  y.val; }
    bool operator<=(const modint& y) const { return val <= y.val; }
    bool operator> (const modint& y) const { return val >  y.val; }
    bool operator>=(const modint& y) const { return val >= y.val; }
    modint operator+(const modint& y) const { return (val + y.val) % M; }
    modint operator*(const modint& y) const { return val * y.val % M; }
    modint operator^(const ll y) const {
        if(y == 0) {
            return 1;
        } else {
            modint z = *this^(y / 2);
            return z * z * (y % 2 ? *this : 1);
        }
    }
    modint operator^(const modint& y) const { return *this ^ y.val; }
    modint operator-() const { return M - val; }
    modint operator~() const { return *this ^ (M - 2); }
    modint operator-(const modint& y) const { return *this + -y; }
    modint operator/(const modint& y) const { return *this * ~y; }
    modint& operator=(const modint& y) { val = y.val; return *this; }
    modint& operator+=(const modint& y) { return *this = *this + y; }
    modint& operator*=(const modint& y) { return *this = *this * y; }
    modint& operator^=(const modint& y) { return *this = *this ^ y; }
    modint& operator-=(const modint& y) { return *this = *this - y; }
    modint& operator/=(const modint& y) { return *this = *this / y; }
    modint& operator++() { return *this += 1; }
    modint& operator--() { return *this -= 1; }
    modint operator++(int) { modint m = *this; ++(*this); return m; }
    modint operator--(int) { modint m = *this; --(*this); return m; }
};
ostream& operator<<(ostream& os, const modint& m) { return os << m.val; }
istream& operator>>(istream& is, modint& m) { is >> m.val; m.val %= M; return is; }
bool operator==(long long x, const modint& y) { return modint((x + M) % M) == y; }
bool operator!=(long long x, const modint& y) { return modint((x + M) % M) != y; }
bool operator< (long long x, const modint& y) { return modint((x + M) % M) <  y; }
bool operator<=(long long x, const modint& y) { return modint((x + M) % M) <= y; }
bool operator> (long long x, const modint& y) { return modint((x + M) % M) >  y; }
bool operator>=(long long x, const modint& y) { return modint((x + M) % M) >= y; }
modint operator+(long long x, const modint& y) { return modint((x + M) % M) + y; }
modint operator*(long long x, const modint& y) { return modint((x + M) % M) * y; }
modint operator-(long long x, const modint& y) { return modint((x + M) % M) - y; }
modint operator/(long long x, const modint& y) { return modint((x + M) % M) / y; }
#endif
#ifndef __PERMUTATIONS_INCLUDED_
#define __PERMUTATIONS_INCLUDED_
modint fact(int n) {
    static vector<modint> fac = {1};
    while(fac.size() <= n) {
        fac.push_back(fac.back() * fac.size());
    }
    return fac[n];
}
modint fact_inv(int n) {
    static vector<modint> inv_fac = {1};
    while(inv_fac.size() <= n) {
        inv_fac.push_back(inv_fac.back() / inv_fac.size());
    }
    return inv_fac[n];
}
#endif
#ifndef __COMBINATIONS_INCLUDED_
#define __COMBINATIONS_INCLUDED_
modint C(int n, int k) {
    return fact(n) * fact_inv(k) * fact_inv(n - k);
}
#endif
modint C_positive(int n, int k) {
    return n == 0 ? 1 : C(n - 1, k - 1);
}
modint C_positive(int n) {
    return n == 0 ? 1 : modint(2) ^ (n - 1);
}
modint C_nonnegative(int n, int k) {
    return C(n + k - 1, k - 1);
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    map<int, int> factorization;
    factorize<int>(m, [&](int d) { factorization[d]++; });
    modint ans = 1;
    for(auto& p : factorization) {
        ans *= C_nonnegative(p.second, n);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 2676