stablegradients/pie-gem5-pairs huggingface dataset:
// 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: 2.0240279329815105x):
#include<bits/stdc++.h>

#define LL long long

#define maxn 201900

#define mod 1000000007

using namespace std;

LL fun[maxn],ans=1;

LL power(LL a,int k)

{

    LL ans=1,y=a;

    while(k)

	{

        if(k%2)

        ans=ans*y%mod;

        

		y=y*y%mod,k=k/2;

    }

    return ans;

}

int main()

{

    long long n,m;

    scanf("%lld%lld",&n,&m);

    fun[0]=1;

    for(int i=1;i<maxn;i++)

	fun[i]=fun[i-1]*i%mod;

    

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

	{

        if(m%i==0)

		{

            long long s=0;

            while(m%i==0) 

			{

                m=m/i;

                s++;

            }

            ans=ans*fun[n+s-1]%mod*power(fun[n-1],mod-2)%mod*power(fun[s],mod-2)%mod;

        }

    }

    if(m>1)

    ans=ans*n%mod;

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

    

    return 0;

}
// 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: 2.0367067482824135x):
#include<bits/stdc++.h>

using namespace std;



#define Fast            ios_base::sync_with_stdio(false);cin.tie(nullptr);

#define LL              long long

#define ff              first

#define ss              second

#define pb              push_back

#define pii             pair<int,int>

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

#define FOR(i,a,b)      for(LL i=a;i<=b;i++)

#define ROF(i,a,b)      for(LL i=a;i>=b;i--)

#define REP(i,b)        for(LL i=0;i<b;i++)



const LL mod=1e9+7;

LL bigmod(LL b, LL p){

    LL ret=1;

    while(p){

        if(p & 1) ret=(ret*b)%mod;

        b=(b*b)%mod;

        p/=2;

    }

    return ret;

}



const LL N=200005;

LL fact[N];

void Fact(){

    fact[0]=1;

    FOR(i,1,N-1) fact[i]=(fact[i-1]*i)%mod;

}



LL nCr(LL n,LL r){

    LL up=fact[n];

    LL down=(fact[r]*fact[n-r])%mod;

    down=bigmod(down,mod-2);

    return (up*down)%mod;

}



int main()

{

    Fact();

    LL n,m;

    scanf("%lld %lld",&n,&m);

    LL ans=1;

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

        if(m%i==0){

            LL cnt=0;

            while(m%i==0){

                m/=i;

                cnt++;

            }

            ans=(ans*nCr(n+cnt-1,cnt))%mod;

        }

    }

    if(m>1) ans=(ans*nCr(n,1))%mod;

    printf("%lld",ans);

}
// Slower C++ solution:
#include<bits/stdc++.h> //Ithea Myse Valgulious

namespace chtholly{

typedef long long ll;

#define re0 register int

#define rec register char

#define rel register ll

#define gc getchar

#define pc putchar

#define p32 pc(' ')

#define pl puts("")

/*By Citrus*/

inline int read(){

  int x=0,f=1;char c=gc();

  for (;!isdigit(c);c=gc()) f^=c=='-';

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return f?x:-x;

  }

template <typename mitsuha>

inline bool read(mitsuha &x){

  x=0;int f=1;char c=gc();

  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';

  if (!~c) return 0;

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return x=f?x:-x,1;

  }

template <typename mitsuha>

inline int write(mitsuha x){

  if (!x) return 0&pc(48);

  if (x<0) x=-x,pc('-');

  int bit[20],i,p=0;

  for (;x;x/=10) bit[++p]=x%10;

  for (i=p;i;--i) pc(bit[i]+48);

  return 0;

  }

inline char fuhao(){

  char c=gc();

  for (;isspace(c);c=gc());

  return c;

  }

}using namespace chtholly;

using namespace std;

const int yuzu=2e5,mod=1e9+7;

typedef ll fuko[yuzu|10];

fuko cnt,jic={1},inv;



ll kasumi(ll a,ll b=mod-2){

ll s=1;

for (;b;b>>=1,a=a*a%mod) if (b&1) s=s*a%mod;

return s;

}



ll zuhe(int n,int m){

return jic[n]*inv[m]%mod*inv[n-m]%mod;

}



int main(){

int j,n=read(),m=read(),i;

for (i=1;i<=yuzu;++i) jic[i]=jic[i-1]*i%mod;

inv[yuzu]=kasumi(jic[yuzu]);

for (i=yuzu-1;~i;--i) inv[i]=inv[i+1]*(i+1)%mod;

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

  if (m%i==0) for (++*cnt;m%i==0;cnt[*cnt]++) m/=i;

if (m>1) cnt[++*cnt]++;

ll ans=1;

for (i=1;i<=*cnt;++i) ans=ans*zuhe(cnt[i]+n-1,cnt[i])%mod;

write(ans);

}

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



using namespace std;



typedef long long ll;

const int mod=1e9+7;



ll a[100500][100];



ll comb(int x,int y){

	if(a[x][y]) 

		return a[x][y];

	if(y==0||y==x ) 

		return a[x][y]=1;

	return a[x][y]=(comb(x-1,y)+comb(x-1,y-1))%mod;

}



int main(){

	ll m,n;

	cin>>n>>m;

	ll x=m,p=2,ans=1;

	while(p*p<=m){

		int cnt=0;

		while(x%p==0){

			x/=p;

			cnt++;

		}

		if(cnt){

			ans=(ans*comb(n+cnt-1,cnt)) % mod;

		}

		p++;

	}

	if(x!=1)

		ans=(ans*n)%mod;

	cout<<ans<<endl;

}
// Slower C++ solution:
/*

  Code By RyeCatcher

*/

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <algorithm>

#include <cctype>

#include <vector>

#include <queue>

#include <cmath>

#include <utility>

#define ri register int

#define ll long long

#define ull unsigned long long

#define pb push_back

#define DEBUG freopen("dat.in","r",stdin);freopen("wa.out","w".stdout);

#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}

#define SIZE 23333

using std::min;

using std::max;

using std::pair;

using std::queue;

using std::priority_queue;

using std::vector;

inline char gc(){

    static char buf[SIZE],*p1=buf,*p2=buf;

    return p1==p2&&(p2=(p1=buf)+fread(buf,1,SIZE,stdin),p1==p2)?EOF:*p1++;

}

#define gc getchar

template <class T>inline void read(T &x){

	x=0;int ne=0;char c;

    while((c=gc())>'9'||c<'0')ne=c=='-';x=c-48;

    while((c=gc())>='0'&&c<='9')x=(x<<3)+(x<<1)+c-48;x=ne?-x:x;return ;

}

const int maxn=100155;

const int size=100150;

const int inf=0x7fffffff;

const ll P=1e9+7;

int n,m;

int c[maxn],tot=0;

ll fac[maxn],inv_fac[maxn];

ll C(int n,int m){

	return fac[m]*inv_fac[n]%P*inv_fac[m-n]%P;

}

ll ksm(ll a){

	ll ans=1;

	ll c=P-2;

	while(c){

		if(c&1)ans=ans*a%P;

		a=a*a%P;

		c=c>>1;

	}

	return ans%P;

}

int main(){

	int x,y,M;

	read(n),read(m);

	M=m;

	for(ri i=2;i*i<=M;i++){

		if(M%i==0){

			c[++tot]=1;

			M/=i;

			while(M%i==0){M/=i;c[tot]++;}

		}

	}

	if(M>1)c[++tot]=1;

	fac[0]=fac[1]=1;

	for(ri i=2;i<=size;i++)

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

	inv_fac[size]=ksm(fac[size]);

	for(ri i=size-1;i>=0;i--)

		inv_fac[i]=inv_fac[i+1]*1ll*(i+1)%P;

	ll ans=1;

	for(ri i=1;i<=tot;i++){

		ans=ans*C(n-1,n+c[i]-1)%P;

	}

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

	return 0;

}


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



using namespace std;



typedef long long ll;

const int mod=1e9+7;



ll a[100500][100];



ll comb(int x,int y){

	if(a[x][y]) 

		return a[x][y];

	if(y==0||y==x ) 

		return a[x][y]=1;

	return a[x][y]=(comb(x-1,y)+comb(x-1,y-1))%mod;

}



int main(){

	ll m,n;

	cin>>n>>m;

	ll x=m,p=2,ans=1;

	while(p*p<=m){

		int cnt=0;

		while(x%p==0){

			x/=p;

			cnt++;

		}

		if(cnt){

			ans=(ans*comb(n+cnt-1,cnt)) % mod;

		}

		p++;

	}

	if(x!=1)

		ans=(ans*n)%mod;

	cout<<ans<<endl;

}
// Slower C++ solution:
#include<bits/stdc++.h> //Ithea Myse Valgulious

namespace chtholly{

typedef long long ll;

#define re0 register int

#define rec register char

#define rel register ll

#define gc getchar

#define pc putchar

#define p32 pc(' ')

#define pl puts("")

/*By Citrus*/

inline int read(){

  int x=0,f=1;char c=gc();

  for (;!isdigit(c);c=gc()) f^=c=='-';

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return f?x:-x;

  }

template <typename mitsuha>

inline bool read(mitsuha &x){

  x=0;int f=1;char c=gc();

  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';

  if (!~c) return 0;

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return x=f?x:-x,1;

  }

template <typename mitsuha>

inline int write(mitsuha x){

  if (!x) return 0&pc(48);

  if (x<0) x=-x,pc('-');

  int bit[20],i,p=0;

  for (;x;x/=10) bit[++p]=x%10;

  for (i=p;i;--i) pc(bit[i]+48);

  return 0;

  }

inline char fuhao(){

  char c=gc();

  for (;isspace(c);c=gc());

  return c;

  }

}using namespace chtholly;

using namespace std;

const int yuzu=2e5,mod=1e9+7;

typedef ll fuko[yuzu|10];

fuko cnt,jic={1},inv;



ll kasumi(ll a,ll b=mod-2){

ll s=1;

for (;b;b>>=1,a=a*a%mod) if (b&1) s=s*a%mod;

return s;

}



ll zuhe(int n,int m){

return jic[n]*inv[m]%mod*inv[n-m]%mod;

}



int main(){

int j,n=read(),m=read(),i;

for (i=1;i<=yuzu;++i) jic[i]=jic[i-1]*i%mod;

inv[yuzu]=kasumi(jic[yuzu]);

for (i=yuzu-1;~i;--i) inv[i]=inv[i+1]*(i+1)%mod;

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

  if (m%i==0) for (++*cnt;m%i==0;cnt[*cnt]++) m/=i;

if (m>1) cnt[++*cnt]++;

ll ans=1;

for (i=1;i<=*cnt;++i) ans=ans*zuhe(cnt[i]+n-1,cnt[i])%mod;

write(ans);

}

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

using namespace std;

const int N = 1e5+20 , SIZE = 1020 , Mod = 1e9+7;

int n,m,p[SIZE],a[SIZE],cnt,fac[2*N],inv[2*N],Max,ans;

inline int add(int x,int y) { return x + y >= Mod ? x + y - Mod : x + y; }

inline int mul(int x,int y) { return 1LL * x * y % Mod; }

inline void Add(int &x,int y) { x = add( x , y ); }

inline void Mul(int &x,int &y) { x = mul( x , y ); }

inline int quickpow(int a,int b) { int res = 1; for (;b;Mul(a,a),b>>=1) if ( 1 & b ) Mul(res,a); return res; }

inline int C(int a,int b) { return 1LL * fac[a] * inv[b] % Mod * inv[a-b] % Mod; }

int main(void)

{

    scanf("%d%d",&n,&m);

    int val = m;

    for (int i=2;i*i<=val;i++)

        if ( m % i == 0 )

        {

            p[++cnt] = i;

            while ( m % i == 0 )

                m /= i , Max = max( Max , ++a[cnt] );

        }

    if ( m > 1 ) p[++cnt] = m , Max = max( Max , a[cnt] = 1 );

    fac[0] = inv[0] = 1LL;

    for (int i=1;i<=n+Max;i++)

        fac[i] = mul( fac[i-1] , i );

    inv[n+Max] = quickpow( fac[n+Max] , Mod-2 );

    for (int i=n+Max-1;i>=1;i--)

        inv[i] = mul( inv[i+1] , i+1 );

    ans = 1LL;

    for (int i=1;i<=cnt;i++)

        ans = 1LL * ans * C( a[i] + n - 1 , n - 1 ) % Mod;

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

    return 0;

}
// Slower C++ solution:
/*

  Code By RyeCatcher

*/

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <algorithm>

#include <cctype>

#include <vector>

#include <queue>

#include <cmath>

#include <utility>

#define ri register int

#define ll long long

#define ull unsigned long long

#define pb push_back

#define DEBUG freopen("dat.in","r",stdin);freopen("wa.out","w".stdout);

#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}

#define SIZE 23333

using std::min;

using std::max;

using std::pair;

using std::queue;

using std::priority_queue;

using std::vector;

inline char gc(){

    static char buf[SIZE],*p1=buf,*p2=buf;

    return p1==p2&&(p2=(p1=buf)+fread(buf,1,SIZE,stdin),p1==p2)?EOF:*p1++;

}

#define gc getchar

template <class T>inline void read(T &x){

	x=0;int ne=0;char c;

    while((c=gc())>'9'||c<'0')ne=c=='-';x=c-48;

    while((c=gc())>='0'&&c<='9')x=(x<<3)+(x<<1)+c-48;x=ne?-x:x;return ;

}

const int maxn=100155;

const int size=100150;

const int inf=0x7fffffff;

const ll P=1e9+7;

int n,m;

int c[maxn],tot=0;

ll fac[maxn],inv_fac[maxn];

ll C(int n,int m){

	return fac[m]*inv_fac[n]%P*inv_fac[m-n]%P;

}

ll ksm(ll a){

	ll ans=1;

	ll c=P-2;

	while(c){

		if(c&1)ans=ans*a%P;

		a=a*a%P;

		c=c>>1;

	}

	return ans%P;

}

int main(){

	int x,y,M;

	read(n),read(m);

	M=m;

	for(ri i=2;i*i<=M;i++){

		if(M%i==0){

			c[++tot]=1;

			M/=i;

			while(M%i==0){M/=i;c[tot]++;}

		}

	}

	if(M>1)c[++tot]=1;

	fac[0]=fac[1]=1;

	for(ri i=2;i<=size;i++)

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

	inv_fac[size]=ksm(fac[size]);

	for(ri i=size-1;i>=0;i--)

		inv_fac[i]=inv_fac[i+1]*1ll*(i+1)%P;

	ll ans=1;

	for(ri i=1;i<=tot;i++){

		ans=ans*C(n-1,n+c[i]-1)%P;

	}

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

	return 0;

}


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

using namespace std;

const int N = 1e5+20 , SIZE = 1020 , Mod = 1e9+7;

int n,m,p[SIZE],a[SIZE],cnt,fac[2*N],inv[2*N],Max,ans;

inline int add(int x,int y) { return x + y >= Mod ? x + y - Mod : x + y; }

inline int mul(int x,int y) { return 1LL * x * y % Mod; }

inline void Add(int &x,int y) { x = add( x , y ); }

inline void Mul(int &x,int &y) { x = mul( x , y ); }

inline int quickpow(int a,int b) { int res = 1; for (;b;Mul(a,a),b>>=1) if ( 1 & b ) Mul(res,a); return res; }

inline int C(int a,int b) { return 1LL * fac[a] * inv[b] % Mod * inv[a-b] % Mod; }

int main(void)

{

    scanf("%d%d",&n,&m);

    int val = m;

    for (int i=2;i*i<=val;i++)

        if ( m % i == 0 )

        {

            p[++cnt] = i;

            while ( m % i == 0 )

                m /= i , Max = max( Max , ++a[cnt] );

        }

    if ( m > 1 ) p[++cnt] = m , Max = max( Max , a[cnt] = 1 );

    fac[0] = inv[0] = 1LL;

    for (int i=1;i<=n+Max;i++)

        fac[i] = mul( fac[i-1] , i );

    inv[n+Max] = quickpow( fac[n+Max] , Mod-2 );

    for (int i=n+Max-1;i>=1;i--)

        inv[i] = mul( inv[i+1] , i+1 );

    ans = 1LL;

    for (int i=1;i<=cnt;i++)

        ans = 1LL * ans * C( a[i] + n - 1 , n - 1 ) % Mod;

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

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h> //Ithea Myse Valgulious

namespace chtholly{

typedef long long ll;

#define re0 register int

#define rec register char

#define rel register ll

#define gc getchar

#define pc putchar

#define p32 pc(' ')

#define pl puts("")

/*By Citrus*/

inline int read(){

  int x=0,f=1;char c=gc();

  for (;!isdigit(c);c=gc()) f^=c=='-';

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return f?x:-x;

  }

template <typename mitsuha>

inline bool read(mitsuha &x){

  x=0;int f=1;char c=gc();

  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';

  if (!~c) return 0;

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return x=f?x:-x,1;

  }

template <typename mitsuha>

inline int write(mitsuha x){

  if (!x) return 0&pc(48);

  if (x<0) x=-x,pc('-');

  int bit[20],i,p=0;

  for (;x;x/=10) bit[++p]=x%10;

  for (i=p;i;--i) pc(bit[i]+48);

  return 0;

  }

inline char fuhao(){

  char c=gc();

  for (;isspace(c);c=gc());

  return c;

  }

}using namespace chtholly;

using namespace std;

const int yuzu=2e5,mod=1e9+7;

typedef ll fuko[yuzu|10];

fuko cnt,jic={1},inv;



ll kasumi(ll a,ll b=mod-2){

ll s=1;

for (;b;b>>=1,a=a*a%mod) if (b&1) s=s*a%mod;

return s;

}



ll zuhe(int n,int m){

return jic[n]*inv[m]%mod*inv[n-m]%mod;

}



int main(){

int j,n=read(),m=read(),i;

for (i=1;i<=yuzu;++i) jic[i]=jic[i-1]*i%mod;

inv[yuzu]=kasumi(jic[yuzu]);

for (i=yuzu-1;~i;--i) inv[i]=inv[i+1]*(i+1)%mod;

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

  if (m%i==0) for (++*cnt;m%i==0;cnt[*cnt]++) m/=i;

if (m>1) cnt[++*cnt]++;

ll ans=1;

for (i=1;i<=*cnt;++i) ans=ans*zuhe(cnt[i]+n-1,cnt[i])%mod;

write(ans);

}

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

using namespace std;

const long long Mod=1e9+7;

int N,M,cnt=0,c[50]={};

inline long long Mul(int x,int y){

	if(y==0) return 1;

	if(y==1) return x;

	long long X=Mul(x,y/2);

	if(y%2) return X*X%Mod*x%Mod;

	else return X*X%Mod;

}

inline long long C(int n,int m){

	long long Sum=1;

	for(long long i=n-m+1;i<=n;i++) Sum=Sum*i%Mod;

	for(long long i=1;i<=m;i++) Sum=Sum*Mul(i,Mod-2)%Mod;

	return Sum;

}

int main(){

	scanf("%d%d",&N,&M);

	long long x=M;

	for(int i=2;i*1LL*i<=x;i++){

		if(x%i==0){

			++cnt;

			for(;(x%i)==0;x/=i) ++c[cnt];

		}

	}

	if(x>1) c[++cnt]=1;

	long long Ans=1;

	for(int i=1;i<=cnt;i++)

	 Ans*=C(c[i]+N-1,N-1),Ans%=Mod;

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

	return 0;

}
// Slower C++ solution:
/*

  Code By RyeCatcher

*/

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <algorithm>

#include <cctype>

#include <vector>

#include <queue>

#include <cmath>

#include <utility>

#define ri register int

#define ll long long

#define ull unsigned long long

#define pb push_back

#define DEBUG freopen("dat.in","r",stdin);freopen("wa.out","w".stdout);

#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}

#define SIZE 23333

using std::min;

using std::max;

using std::pair;

using std::queue;

using std::priority_queue;

using std::vector;

inline char gc(){

    static char buf[SIZE],*p1=buf,*p2=buf;

    return p1==p2&&(p2=(p1=buf)+fread(buf,1,SIZE,stdin),p1==p2)?EOF:*p1++;

}

#define gc getchar

template <class T>inline void read(T &x){

	x=0;int ne=0;char c;

    while((c=gc())>'9'||c<'0')ne=c=='-';x=c-48;

    while((c=gc())>='0'&&c<='9')x=(x<<3)+(x<<1)+c-48;x=ne?-x:x;return ;

}

const int maxn=100155;

const int size=100150;

const int inf=0x7fffffff;

const ll P=1e9+7;

int n,m;

int c[maxn],tot=0;

ll fac[maxn],inv_fac[maxn];

ll C(int n,int m){

	return fac[m]*inv_fac[n]%P*inv_fac[m-n]%P;

}

ll ksm(ll a){

	ll ans=1;

	ll c=P-2;

	while(c){

		if(c&1)ans=ans*a%P;

		a=a*a%P;

		c=c>>1;

	}

	return ans%P;

}

int main(){

	int x,y,M;

	read(n),read(m);

	M=m;

	for(ri i=2;i*i<=M;i++){

		if(M%i==0){

			c[++tot]=1;

			M/=i;

			while(M%i==0){M/=i;c[tot]++;}

		}

	}

	if(M>1)c[++tot]=1;

	fac[0]=fac[1]=1;

	for(ri i=2;i<=size;i++)

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

	inv_fac[size]=ksm(fac[size]);

	for(ri i=size-1;i>=0;i--)

		inv_fac[i]=inv_fac[i+1]*1ll*(i+1)%P;

	ll ans=1;

	for(ri i=1;i<=tot;i++){

		ans=ans*C(n-1,n+c[i]-1)%P;

	}

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

	return 0;

}


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

using namespace std;

const long long Mod=1e9+7;

int N,M,cnt=0,c[50]={};

inline long long Mul(int x,int y){

	if(y==0) return 1;

	if(y==1) return x;

	long long X=Mul(x,y/2);

	if(y%2) return X*X%Mod*x%Mod;

	else return X*X%Mod;

}

inline long long C(int n,int m){

	long long Sum=1;

	for(long long i=n-m+1;i<=n;i++) Sum=Sum*i%Mod;

	for(long long i=1;i<=m;i++) Sum=Sum*Mul(i,Mod-2)%Mod;

	return Sum;

}

int main(){

	scanf("%d%d",&N,&M);

	long long x=M;

	for(int i=2;i*1LL*i<=x;i++){

		if(x%i==0){

			++cnt;

			for(;(x%i)==0;x/=i) ++c[cnt];

		}

	}

	if(x>1) c[++cnt]=1;

	long long Ans=1;

	for(int i=1;i<=cnt;i++)

	 Ans*=C(c[i]+N-1,N-1),Ans%=Mod;

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

	return 0;

}
// Slower C++ solution:
				#include <bits/stdc++.h>

				using namespace std;

				#define ll long long

				#define mod 1000000007

				#define pll pair<long,long>

				#define se second

				#define fi first

				#define pb push_back

				#include <ext/pb_ds/assoc_container.hpp>

				#include <ext/pb_ds/tree_policy.hpp>

				using namespace __gnu_pbds;



				typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;

				typedef tree<pll,null_type,less<pll>,rb_tree_tag,tree_order_statistics_node_update>pllordered_set;

				

				const ll INF=(ll)1e18;

				ll fac[300050];

				

				ll binpow(ll a,ll b,ll m)

				{

					a%=m;

					ll ans=1;

					while(b)

					{

						if(b&1)

							ans=ans*a%m;

						a=a*a%m;

						b=b>>1;

					}

					return ans;

					

				}

				ll mod_inverse(ll n)

				{

					return binpow(n,mod-2,mod);

				}

				

				ll C(ll n,ll r)

				{

					return fac[n]*mod_inverse(fac[r])%mod * mod_inverse(fac[n-r])%mod;

				}

				

				int main()

				{

					ios_base::sync_with_stdio(false);

					cin.tie(NULL);

					fac[0]=1;

					

					for(ll i=1;i<=300005;i++)

						fac[i]=(i*fac[i-1])%mod;

					

					

					

					ll n,m;

					cin>>n>>m;

					ll ans=1;

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

					{

						ll cnt=0;

						while(m%i==0)

						{

								cnt++;

								m=m/i;

						}

						ans=ans*C(cnt+n-1,n-1);

						ans%=mod;

					}

					if(m>1)

					{

						ans*=C(1+n-1,n-1);

						ans%=mod;

					}

						cout<<ans;

				}

				


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



using namespace std;



typedef long long          ll;

typedef unsigned long long ull;

typedef vector<int>	       vi;

typedef vector<bool>       vb;

typedef map<int, int>      mii;

typedef pair<int, int>     ii;



#define INF                0x3f3f3f3f

#define INFLL              0x3f3f3f3f3f3f3f3f

#define each(x, s)         for(auto& x : s)

#define loop(x)	           for(int i = 0;i < x;i++)

#define vloop(v, x)        for(int v = 0;v < x;v++)

#define avg(l, r)          l + (r - l) / 2

#define iter(a)            a.begin(), a.end()

#define riter(a)           a.rbegin(), a.rend()

#define endl               "\n"



const ll mod = 1000000007;



mii fats(int x) {

	mii fs;

	for (int i = 2;i * i <= x;i++) {

		while (x % i == 0) {

			fs[i]++;

			x /= i;

		}

	}

	if (x > 1) fs[x]++;

	return fs;

}



pair<ll, ll> eucl(ll a, ll b) {

	if (b == 0) return make_pair(1ll, 0ll);

	ll x, y;

	tie(x, y) = eucl(b, a % b);

	return make_pair(y, x - a / b * y);

}



ll inv(ll a) {

	ll x;

	tie(x, ignore) = eucl(a, mod);

	return (x % mod + mod) % mod;

}



ll choose(ll n, ll k) {

	k = min(k, n - k);

	ll a = 1, b = 1;

	loop(k) {

		a *= n - i;

		b *= i + 1;

		a %= mod;

		b %= mod;

	}

	return a * inv(b) % mod;

}



int main() {

	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);



	int n, m;

	cin >> n >> m;

	mii fs = fats(m);

	ll ans = 1;

	each(p, fs) {

		ans *= choose(p.second + n - 1, n - 1);

		ans %= mod;

	}

	cout << ans << endl;

	return 0;

}