#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define ll long long #include #define mod % 1000000007 #define rep(i,n) for(long long i = 0;i < n;i ++) ll MAX = 5'000'000'000'000'000'000LL; using namespace std; vector p; void MAKE_P(){ p = {2,3}; for(int i = 5;i <= 1000000;i ++){ bool z = true; for(ll j:p){ if(i%j==0){ z = false; break; } if(j*j>i)break; } if(z)p.push_back(i); } } int main(){ ll n,m; cin >> n >> m; if(m==1){ cout << 1 << endl; return 0; } MAKE_P(); vector q; rep(i,int(p.size())){ if(m%p[i]==0){ q.push_back(0); while(m%p[i] == 0){ q[int(q.size())-1] ++; m = m/p[i]; } } } if(m>1)q.push_back(1); map mp; for(int i:q){ mp[i] = 1; } vector ans(50); for(auto [i,vaku]:mp){ if(i==0){ ans[0] = 1; continue; } vector> dp(n+1,vector(i+1,0)); dp[0][0] = 1; rep(j,n){ rep(k,i+1){ dp[j][k] = dp[j][k] mod; rep(l,i+1){ if(l+k>i)break; dp[j+1][l] += dp[j][k]; } } } rep(j,i+1)ans[i] += dp[n][j]; ans[i] = ans[i] mod; } ll sum = 1; rep(i,int(q.size())){ sum = (sum*ans[q[i]]) mod; } cout << sum << endl; return 0; }