// 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.245988642669501x):
#define mod 1000000007

#define PI acos(-1)

#include<time.h>

#include<stdio.h>

#include<string.h>

#include<math.h>

#include<map>

#include<queue>

#include<iostream>

#include<vector>

#include<algorithm>

using namespace std;

typedef long long ll;

const ll INF=0x7fffffffffffffff;

const int inf=0x7fffffff;

const int N=4e5+5;

clock_t start,finish;

void time_in(){start=clock();}

void time_out(){finish=clock();double tim=(double)(finish-start)/CLOCKS_PER_SEC;printf("Running time is %lf\n",tim);}

inline ll mul(ll a,ll b){ll s=0;while(b){if(b&1)s=(s+a)%mod;a=(a<<1)%mod;b>>=1;}return s%mod;}

inline ll pow_mul(ll a,ll b){ll s=1;while(b){if(b&1)s=mul(s,a);a=mul(a,a);b>>=1;}return s;}

inline ll poww(ll a,ll b){ll s=1;while(b){if(b&1)s=(s*a)%mod;a=(a*a)%mod;b>>=1;}return s%mod;}

inline bool read(int &ret){char c=getchar();int sgn;if(c==EOF)return 0;while(c!='-'&&(c<'0'||c>'9'))c=getchar();

	sgn=((c=='-')?-1:1);ret=((c=='-')?0:(c-'0'));while(c=getchar(),c>='0'&&c<='9')ret=ret*10+(c-'0');ret*=sgn;return 1;}

inline void write(int x){if(x>9)write(x/10);putchar(x%10+'0');}

int fact[10]={1,1,2,6,24,120,720,5040,40320,362880};

int st[4][2]={1,0,0,1,-1,0,0,-1};

int t,cas;

int k;

ll inv(ll a)

{

	return a==1?1:((mod-mod/a)*inv(mod%a))%mod;

}

ll c(ll a,ll b)

{

	if(a-b<b)b=a-b;

	ll u=1,d=1;

	for(ll i=0;i<b;i++)

	{

		u=(u*(a-i))%mod;

		d=(d*(i+1))%mod;

	}

	return (u*inv(d))%mod;

}

int main()

{

	ll m,n,cnt,ans,sum;

	while(~scanf("%lld%lld",&n,&m))

	{

		sum=0;

		ans=1;

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

		{

			if(m%i==0)

			{

				cnt=0;

				while(m%i==0)

				{

					cnt++;

					m/=i;

				}

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

			}

		}

		if(m!=1)

		{

			ans=(ans*n)%mod;

		}

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

	}

}