#include #define rep(i, p, n) for (ll i = p; i < (ll)(n); i++) #define rep2(i, p, n) for (ll i = p; i >= (ll)(n); i--) using namespace std; using ll = long long; using ld = long double; const double pi = 3.141592653589793; const long long inf = 2 * 1e9; const long long linf = 4 * 1e18; const ll mod1 = 1000000007; const ll mod2 = 998244353; template inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } // atcoder #include using namespace atcoder; using mint1 = modint1000000007; using mint2 = modint998244353; vector> base = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; int main() { ////////////////// ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); ////////////////// ll N, M; cin >> N >> M; set st; ll temp = M; vector C; rep(i, 1, sqrt(M)) { ll co = 0; while (true) { // cout << i << temp << endl; if (temp % (i + 1) == 0) { temp /= (i + 1); co++; } else { break; } } if (co > 0) { C.push_back(co); } } if (temp != 1) { C.push_back(1); } mint1 ans = 1; rep(i, 0, C.size()) { // cout << C.at(i) << endl; vector> dp(N + 1, vector(C.at(i) + 1)); dp[0][0] = 1; rep(j, 0, N) { mint1 F = 0; rep(k, 0, C.at(i) + 1) { F += dp[j][k]; dp[j + 1][C.at(i) - k] += F; } } mint1 temp = 0; rep(j, 0, C.at(i) + 1) { temp += dp[N][j]; } ans *= temp; } cout << ans.val() << endl; return 0; }