Problem:
Score : 400 points

Problem Statement

You are given positive integers N and M.

How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7.

Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.

Constraints

All values in input are integers.

1 \leq N \leq 10^5

1 \leq M \leq 10^9

Input

Input is given from Standard Input in the following format:

N M

Output

Print the number of the sequences consisting of positive integers that satisfy the condition, modulo 10^9 + 7.

Sample Input 1

2 6

Sample Output 1

4

Four sequences satisfy the condition: \{a_1, a_2\} = \{1, 6\}, \{2, 3\}, \{3, 2\} and \{6, 1\}.

Sample Input 2

3 12

Sample Output 2

18

Sample Input 3

100000 1000000000

Sample Output 3

957870001

Solution in C++14 (GCC 5.4.1) (judge verdict: Accepted)

// https://atcoder.jp/contests/abc110/tasks/abc110_d
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define EPS (1e-9)
#define INF (1e9)
#define INFL (1e18)
#define MOD (1000000007)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define BIT(n) (1LL << (n))
// ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
// ll lcm(ll c, ll d) { return c / gcd(c, d) * d; }

vector<pair<long long, long long>> prime_factorize(long long n) {
    vector<pair<long long, long long>> res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0)
            continue;
        int num = 0;
        while (n % p == 0) {
            ++num;
            n /= p;
        }
        res.push_back({p, num});
    }
    if (n != 1)
        res.push_back({n, 1});
    return res;
}

ll modpow(ll a, ll n) {
    ll r = 1;
    while (n)
        r = r * ((n % 2) ? a : 1) % MOD, a = a * a % MOD, n >>= 1;
    return r;
}

ll comb(int P_, int Q_) {
    if (P_ < 0 || Q_ < 0 || Q_ > P_)
        return 0;
    ll p = 1, q = 1;
    Q_ = min(Q_, P_ - Q_);
    for (int i = 1; i <= Q_; i++)
        p = p * P_ % MOD, q = q * i % MOD, P_--;

    return p * modpow(q, MOD - 2) % MOD;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    vector<PLL> v = prime_factorize(m);

    ll ans = 1;
    for (auto x : v) {
        ans = (ans * comb(x.second + n - 1, n - 1)) % MOD;
    }

    cout << ans << endl;

    return 0;
}