#include using namespace std; typedef long long int ll; typedef pair P; typedef vector VI; typedef vector VVI; #define REP(i,n) for(ll i=0;i<(n);i++) #define ALL(v) v.begin(),v.end() template bool chmax(T &x, const T &y) {return (x bool chmin(T &x, const T &y) {return (x>y)?(x=y,true):false;}; constexpr ll MOD=1000000007; constexpr ll INF=2e18; ll power(ll x, ll y){ x%=MOD; ll ret=1; while(y){ if(y&1) ret=ret*x%MOD; x=x*x%MOD; y>>=1; } return ret; } int main(){ ll n, m; cin >> n >> m; ll x=m; map mp; for(ll i=2;i<=sqrt(m);i++){ ll cnt=0; while(x%i==0){ x/=i; cnt++; } mp[cnt]++; } if(x!=1) mp[1]++; ll ans=1; for(auto p:mp){ ll l=p.first+1; VI dp(l,0); dp[0]=1; REP(i,n){ VI ndp(l,0); ll sum=0; REP(j,l){ sum=(sum+dp[j])%MOD; ndp[l-1-j]=sum; } dp=ndp; } ll s=0; REP(i,l) s=(s+dp[i])%MOD; ans=ans*power(s,p.second)%MOD; } cout << ans << endl; return 0; }