// Slower C++ solution:
//此程序使用了qt专属名称，请勿模仿。侵权必究！！！

//我真是太菜了…… 

#include<bits/stdc++.h>

using namespace std;

#define ll long long

const ll N=20,P=1e9+7;

ll n,m,ans=1,a[1<<N]={1};

inline ll read()

{

	ll sum=0,flag=1;

	char c;

	for(;c<'0'||c>'9';c=getchar())if(c=='-') flag=-1;

	for(;c>='0'&&c<='9';c=getchar())sum=(sum<<1)+(sum<<3)+c-'0';

	return sum*flag;

}

inline ll pow(ll x,ll y)

{

	ll k=1;

	while(y)

	{

		if(y&1)

		{

			k*=x;

			k%=P;

		}

		y>>=1;

		x*=x;

		x%=P;

	}

	return k;

}

int main()

{

//	freopen("a.in","r",stdin);

//	freopen("a.out","w",stdout);

	n=read();

	m=read();

	for(int i=1;i<=1<<(N-1);++i)

	{

		a[i]=a[i-1]*i%P;

	}

	for(ll i=2;i*i<=m;++i)

	{

		if(!(m%i))

		{

			ll k=0;

			while(!(m%i))

			{

				++k;

				m/=i;

			}

			ans*=a[n+k-1]%P*pow(a[n-1],P-2)%P*pow(a[k],P-2)%P;

			ans%=P;

		}

	}

	if(m>1)

	{

		ans*=n;

		ans%=P;

	}

	printf("%lld\n",ans);

	return 0;

}






// Faster C++ solution for the same problem (measured speedup: 1.8184888523248588x):
#include <bits/stdc++.h>

using namespace std;

#define ll long long

#define LLMAX (1ll << 60) - 1

#define INTMAX (1 << 30) - 1

#define MOD 1000000007 

#define NMAX 1000*100+1



#define numberOfSetBits(S) __builtin_popcount(S) // __builtin_popcountl(S) __builtin_popcountll(S)

#define MSET(x,y) memset(x,y,sizeof(x))

#define gcd(a,b) __gcd(a,b)

#define all(x)  x.begin(),x.end()

#define isOn(S, j) (S & (1 << j))

#define endl '\n'

#define setBit(S, j) (S |= (1 << j))

#define clearBit(S, j) (S &= ~(1 << j))

#define toggleBit(S, j) (S ^= (1 << j))

#define print(x)    for(auto it:x) cout<<it<<' '; cout<<endl;

#define printii(x)  for(auto it:x) cout<<it.F<<' '<<it.S<<'\t';  cout<<endl;

#define in(x,n)   for(int e=0;e<n;e++){ll y;cin>>y;x.pb(y);}



#define vi vector<ll>

#define vvi vector<vi>

#define ii pair<ll,ll>

#define pll pair<ll,ll>

#define vii vector<ii>

#define vvii vector<vii>

#define viii vector<pair<ii,ll>>

#define pb push_back

#define F first

#define S second

#define mp make_pair

#define mc(a,b,c) mp(mp(a,b),c)



struct mint {

    typedef decay<decltype(MOD)>::type T; 

    T v; explicit operator T() const { return v; }

    mint() { v = 0; }

    mint(ll _v) { 

        v = (-MOD < _v && _v < MOD) ? _v : _v % MOD;

        if (v < 0) v += MOD;

    }

    friend bool operator==(const mint& a, const mint& b) { 

        return a.v == b.v; }

    friend bool operator!=(const mint& a, const mint& b) { 

        return !(a == b); }

    friend bool operator<(const mint& a, const mint& b) { 

        return a.v < b.v; }   

    mint& operator+=(const mint& m) { 

        if ((v += m.v) >= MOD) v -= MOD; 

        return *this; }

    mint& operator-=(const mint& m) { 

        if ((v -= m.v) < 0) v += MOD; 

        return *this; }

    mint& operator*=(const mint& m) { 

        v = (ll)v*m.v%MOD; return *this; }

    mint& operator/=(const mint& m) { return (*this) *= inv(m); }

    friend mint pow(mint a, ll p) {

        mint ans = 1; assert(p >= 0);

        for (; p; p /= 2, a *= a) if (p&1) ans *= a;

        return ans;

    }

    friend mint inv(const mint& a) { assert(a.v != 0); 

        return pow(a,MOD-2); }

        

    mint operator-() const { return mint(-v); }

    mint& operator++() { return *this += 1; }

    mint& operator--() { return *this -= 1; }

    friend mint operator+(mint a, const mint& b) { return a += b; }

    friend mint operator-(mint a, const mint& b) { return a -= b; }

    friend mint operator*(mint a, const mint& b) { return a *= b; }

    friend mint operator/(mint a, const mint& b) { return a /= b; }

};



vector<mint> fact,f;



void bincoeff(ll n){

    fact.resize(n+1);

    fact[0] = 1;

    for(ll i=1;i<=n;i++){

        fact[i] = fact[i-1]*i;

    }

}



mint ncr(ll n, ll r){

    if((n<0)||(r<0)||((n-r)<0))return 0;

    return (fact[n]/(fact[n-r]*fact[r]));

}



map<ll,ll> fak;



int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    ll n,x,t,m,y,z;

    cin>>n>>m;

    bincoeff(2e5+5);

    // n+x-1Cx

    z = m;

    for(ll i=2;i*i<=m;i++){

        while(z%i==0){

            z/=i;

            fak[i]++;

        }

    }

    if(z!=1){

        fak[z]++;

    }

    mint ans = 1;

    for(auto it:fak){

        ans*=ncr(n+it.S-1,it.S);

    }

    cout<<ans.v;

    









    



    return 0;

}