// dfmt off
T lread(T=long)(){return readln.chomp.to!T;}T[] lreads(T=long)(long n){return iota(n).map!((_)=>lread!T).array;}
T[] aryread(T=long)(){return readln.split.to!(T[]);}void arywrite(T)(T a){a.map!text.join(' ').writeln;}
void scan(L...)(ref L A){auto l=readln.split;foreach(i,T;L){A[i]=l[i].to!T;}}alias sread=()=>readln.chomp();
void dprint(L...)(lazy L A){debug{auto l=new string[](L.length);static foreach(i,a;A)l[i]=a.text;arywrite(l);}}
static immutable MOD=10^^9+7;alias PQueue(T,alias l="b<a")=BinaryHeap!(Array!T,l);import std, core.bitop;
// dfmt on

void main()
{
    long N, M;
    scan(N, M);
    auto f = factorize(M);
    long ans = 1;
    auto C = Combination_mod(500000);
    foreach (key, val; f)
    {
        ans *= C(val + N - 1, val);
        ans %= MOD;
    }
    writeln(ans);
}

T[U] factorize(T = long, U = long)(T x)
{
    assert(0 < x, "x is negative");
    long[long] ps;
    while ((x & 1) == 0)
        x /= 2, ps[2] = (2 in ps) ? ps[2] + 1 : 1;
    for (long i = 3; i * i <= x; i += 2)
        while (x % i == 0)
            x /= i, ps[i] = (i in ps) ? ps[i] + 1 : 1;
    if (x != 1)
        ps[x] = (x in ps) ? ps[x] + 1 : 1;
    return ps;
}

/// Number of k-combinations % m (precalculated)
alias Combination_mod = Combination_modImpl!long;
struct Combination_modImpl(T)
{
    T _n, _m;
    T[] _fact, _factinv;
    this(T maxnum, T mod = 10 ^^ 9 + 7)
    {
        _n = maxnum, _m = mod, _fact = new T[](_n + 1), _factinv = new T[](_n + 1), _fact[0] = 1;
        foreach (i; 1 .. _n + 1)
            _fact[i] = _fact[i - 1] * i % _m;
        T powmod(T x, T n, T m)
        {
            if (n < 1)
                return 1;
            if (n & 1)
            {
                return x * powmod(x, n - 1, m) % m;
            }
            T tmp = powmod(x, n / 2, m);
            return tmp * tmp % m;
        }

        foreach (i; 0 .. _n + 1)
            _factinv[i] = powmod(_fact[i], _m - 2, _m);
    }

    T opCall(T n, T k, T dummy = 10 ^^ 9 + 7)
    {
        return n < k ? 0 : ((_fact[n] * _factinv[n - k] % _m) * _factinv[k] % _m);
    }
}
