#include<bits/stdc++.h>

using namespace std;
using ll = long long int;

int main(void) {
    constexpr ll MOD = 1e9 + 7;
    cout << fixed << setprecision(16);

    ll n, m;
    cin >> n >> m;
    vector<ll> v;

    for(ll a=2; a*a<=m; a++) {
        ll t = 0;
        while(m % a == 0)
            m /= a, t++;
        if(t) v.push_back(t);
    }
    if(m > 1) v.push_back(1);

    ll r = 1;

    auto inv = [&](ll x) {
        ll r = 1, b = MOD-2;
        while(b) {
            if(b&1) (r *= x) %= MOD;
            (x *= x) %= MOD;
            b >>= 1;
        }
        return r;
    };

    for(auto &x: v) {
        // x+n-1 C x
        for(ll i=0; i<x; i++)
            (r *= x+n-1-i) %= MOD, (r *= inv(i+1)) %= MOD;
    }
    cout << r << endl;

}
