//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;

const int mod = 1000000007;
//const int mod = 998244353;

struct mint {
    int64_t x;
    mint(int64_t x=0):x((x%mod+mod)%mod){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(int64_t t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    //for prime mod
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) {return mint(*this) /= a;}
};

istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

struct Sieve {
    int n;
    vector<int> f, primes;
    Sieve(int n=1):n(n), f(n+1) {
        f[0] = f[1] = -1;
        for(int64_t i=2; i<=n; ++i) {
            if(f[i]) continue;
            primes.push_back(i);
            f[i] = i;
            for(int64_t j = i*i; j <= n; j += i) {
                if(!f[j]) f[j] = i;
            }
        }
    }
    //素数判定
    bool isPrime(int x) {return f[x] == x;}
    //素数列挙
    vector<int > factorList(int x) {
        assert(x <= n);
        vector<int> res;
        while(x != 1) {
            res.emplace_back(f[x]);
            x /= f[x];
        }
        return res;
    }
    //素因数分解　pair(素数, 素因数の数)
    vector<pair<int, int> > factor(int x) {
        vector<int> fl = factorList(x);
        if(fl.size() == 0) return {};
        vector<pair<int, int> > res(1, pair<int, int>(fl[0], 0));
        for(int p : fl) {
            if(res.back().first == p) {
                ++res.back().second;
            } else {
                res.emplace_back(p, 1);
            }
        }
        return res;
    }
} pp(sqrt(1000000000)+1);

struct combination {
    vector<mint> frac, ifrac;
    combination(int n):frac(n+1), ifrac(n+1) {
        assert(n < mod);
        frac[0] = 1;
        for (int i = 1; i <= n; ++i) frac[i] = frac[i-1]*i;
        ifrac[n] = frac[n].inv();
        for (int i = n; i >= 1; --i) ifrac[i-1] = ifrac[i]*i;
    }
    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return frac[n]*ifrac[k]*ifrac[n-k];
    }
} c(1000000);

int main() {
    int n, m;
    cin >> n >> m;

    map<int, int> ff;
    for(auto x:pp.primes) {
        while(!(m%x)) {
            ff[x]++;
            m /= x;
        }
    }
    if(m != 1) {
        ff[m]++;
    }

    int ma = 0;
    vi vec;
    for(P x:ff) {
        if(ma < x.second) ma = x.second;
        vec.push_back(x.second);
    }

    mint ans=1;
    for(int x:vec) {
        ans *= c(x+n-1, x);
    }

    cout << ans << endl;
}

Measured memory_bytes: 16128