#include <bits/stdc++.h>
using namespace std;
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using ll = long long;
constexpr i64 INF = 1010000000000000017LL;
constexpr i64 MOD = 1000000007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }
template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) xmax = x; return true;
    return false;
}
template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) xmin = x; return true;
    return false;
}
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;
    ProconInit() {
        cin.tie(nullptr); ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH) cout << unitbuf;
    }
} PROCON_INIT;

template <typename TYPE, TYPE Mod>
struct Combination_template
{
    size_t size;
    std::vector<TYPE> fc, inv_fc;
    Combination_template(int N)
    :size(N), fc(size), inv_fc(size)
    {
        fc[0] = 1;
        for (int i = 1; i <= N; ++i) { fc[i] = fc[i - 1] * i % Mod; }
        inv_fc[N] = inv(fc[N]);
        for (int i = N - 1; i >= 0; --i) { inv_fc[i] = inv_fc[i + 1] * (i+1) % Mod; }
    }
    TYPE fact(TYPE n) const { return fc[n]; }
    TYPE inv_fact(TYPE n) const { return inv_fc[n]; }
    TYPE inv(TYPE n) const { return power(n, Mod - 2); }
    TYPE power(TYPE n, TYPE pow) const {
        TYPE res = 1;
        TYPE exp = n;
        for (; pow; pow /= 2) {
            if (pow & 1) res = res * exp % Mod;
            exp = exp * exp % Mod;
        }
        return res;
    }
    TYPE perm(TYPE n, TYPE r) const {
        if (r < 0 || n < r) return 0;
        return fc[n] * inv_fc[n-r] % Mod;
    }
    TYPE binom(TYPE n, TYPE r) const {
        if (n < 0 || r < 0 || n < r) return 0;
        return fc[n] * inv_fc[r] % Mod * inv_fc[n-r] % Mod;
    }
    TYPE homo(TYPE n, TYPE r) const {
        if (n < 0 || r < 0) return 0;
        return r == 0 ? 1 : binom(n + r - 1, r);
    }
};
using Combination = Combination_template<long long, MOD>;

struct Prime
{
    static
    bool is_prime(long long n) {
        if (n == 1) return false;
        for (ll a = 2; a * a <= n; ++a) if (n % a == 0) return false;
        return true;
    }

    static
    std::vector<long long> listup(long long n) {
        std::vector<long long> ret;
        for (long long i = 1; i * i < n; ++i) {
            if (n % i == 0) ret.push_back(i);
            long long other = n / i;
            if (other != i) ret.push_back(other);
        }
        std::sort(ret.begin(), ret.end());
        return ret;
    }

    static
    std::vector<std::pair<long long, long long>> factorize(long long n) {
       std::vector<pair<long long, long long>> res;
        for (long long a = 2; a * a <= n; ++a) {
            if (n % a != 0) continue;
            long long ex = 0;
            while (n % a == 0) {
                ++ex;
                n /= a;
            }
            res.push_back({a, ex});
        }
        if (n != 1) res.push_back({n, 1});
        return res;
    }
};

void solve() {
    ll n, m; cin >> n >> m;
    ll ret = 1;
    const auto& res = Prime::factorize(m);
    auto cb = Combination(200010);
    for (auto& p : res) {
        ret *= cb.binom(p.second + n - 1, n - 1);
        ret %= MOD;
    }
    cout << ret << endl;
}

signed main() {
    solve();
    return 0;
}

Measured memory_bytes: 3328