#include <bits/stdc++.h>
#define fst first
#define snd second
#define rep(n) for(lint I = 0; (I) < (lint)(n); ++(I))
#define repeat(i, n) for(lint i = 0; (i) < (lint)(n); ++(i))
#define repeat_to(i, n) for(lint i = 0; (i) <= (lint)(n); ++(i))
#define repeat_from(i, m, n) for(lint i = (m); (i) < (lint)(n); ++(i))
#define repeat_from_to(i, m, n) for(lint i = (m); (i) <= (lint)(n); ++(i))
#define repeat_reverse_from_to(i, m, n) for(lint i = (m); (i) >= (lint)(n); --(i))
#define el cout<<endl
#define dump(x) cout<<" "<<#x<<"="<<x
#define vdump(v) for(size_t I=0; I<v.size(); ++I){cout<<" "<<#v<<"["<<I<<"]="<<v[I];} cout<<endl
using namespace std;
using lint = long long;
using ld = long double;

// べき乗の剰余
lint modpow(lint x, lint y, lint m) {
    if (y == 0) return 1;
    lint res = modpow(x, y / 2, m);
    return res * res % m * (y & 1 ? x : 1) % m;
}

// エラトステネスの篩[2,n]を列挙 O(nloglogn)
vector<lint> sieve_of_eratosthenes(lint n) {
    vector<bool> is_prime(n+1, true);
    is_prime[0] = is_prime[1] = false;
    for (lint i = 2; i*i <= n; ++i)
        if (is_prime[i])
            for (lint k = i+i; k <= n; k += i)
                is_prime[k] = false;
    vector<lint> primes;
    for (lint i = 2; i <= n; ++i)
        if (is_prime[i])
            primes.push_back(i);
    return primes;
}

// 素因数分解
map<lint,lint> factorization(lint n, vector<lint> const & primes) { 
    map<lint,lint> result;
    for (lint p : primes) {
        if (n < p * p) break;
        while (n % p == 0) {
            result[p] += 1;
            n /= p;
        }
    }
    if (n != 1) result[n] += 1;
    return result;
}

template<typename Int, Int MOD>
struct comb_util {
    int sz;
    std::vector<Int> mfact, minv_fact;
    comb_util(int N) : sz(N + 1), mfact(sz), minv_fact(sz) {
        mfact[0] = 1;
        for (int i = 1; i <= sz; i++) mfact[i] = mfact[i - 1] * i % MOD;
        minv_fact[sz] = inv(mfact[sz]);
        for (int i = sz - 1; i >= 0; i--) minv_fact[i] = minv_fact[i + 1] * (i + 1) % MOD;
    }

    // res = first * p^second
    std::pair<Int, Int> fact_willson(Int n) const {
        Int e = 0;
        if (n <= sz) return std::make_pair(mfact[n], 0);
        Int res;
        std::tie(res, e) = fact_willson(n / MOD);
        e += n / MOD;
        if ((n / MOD) % 2 != 0) res = MOD - res;
        return std::make_pair(res * mfact[n % MOD] % MOD, e);
    }

    Int fact(Int n) const { return mfact[n]; }

    Int inv(Int n) const {
        return pow(n, MOD - 2);
    }

    Int pow(Int n, Int a) const {
        Int res = 1, exp = n;
        for(; a; a /= 2) {
            if (a & 1) res = res * exp % MOD;
            exp = exp * exp % MOD;
        }
        return res;
    }

    Int perm(Int n, Int r) {
        if (r < 0 || n < r) return 0;
        else return mfact[n] * minv_fact[n - r] % MOD;
    }

    Int binom_lucus(Int n, Int r) const {
        if (n < 0 || r < 0 || n < r) return 0;
        assert(n <= sz);
        if (n >= MOD) return binom(n % MOD, r % MOD) * binom(n / MOD, r / MOD);
        else return r > n ? 0 : mfact[n] * minv_fact[n - r] * minv_fact[r];
    }

    Int binom(Int n, Int r) const {
        if (n < 0 || r < 0 || n < r) return 0;
        return mfact[n] * minv_fact[r] % MOD * minv_fact[n - r] % MOD;
    }

    Int homo(Int n, Int r) const {
        if (n < 0 || r < 0) return 0;
        return r == 0 ? 1 : binom(n + r - 1, r);
    }
};

int main(void) {
    lint n, m;
    cin >> n >> m;
    const lint MOD = 1e9 + 7;
    auto primes = sieve_of_eratosthenes(1e6);
    auto factors = factorization(m, primes);
    
    comb_util<lint, MOD> cm(300000);
    lint ans = 1;
    for (auto e: factors) {
        //cout << e.snd+(n-1) << "C" << (n-1) << "=" << cm.binom(e.snd+(n-1),(n-1)) << endl;
        ans *= cm.binom(e.snd + (n-1), (n-1));
        ans %= MOD;
    }
    cout << ans << endl;
}

Measured memory_bytes: 5748