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: Wrong Answer)

#include <bits/stdc++.h>
#define LL long long
#define db double
using namespace std;
 
const int MAXN = 1000100;
const int MAXE = 400400;
const int INF = 0x3f3f3f3f;
 
template<typename T> inline void CheckMax(T &A, T B) {
	A < B ? A = B : A;
}
 
template<typename T> inline void CheckMin(T &A, T B) {
	A > B ? A = B : A;
}
 
template <typename T> inline void read(T &x) {
    int c = getchar();
    bool f = false;
    for (x = 0; !isdigit(c); c = getchar()) {
        if (c == '-') {
            f = true;
        }
    }
    for (; isdigit(c); c = getchar()) {
        x = x * 10 + c - '0';
    }
    if (f) {
        x = -x;
    }
}
 
LL n, m;
LL P[MAXN], cnt;

const LL mod = 1000000007;

LL qpow(LL a, LL b) {
	LL ret = 1;
	while(b) {
		if(b & 1) ret *= a;
		ret %= mod;
		a = a * a % mod;
		b >>= 1;
	}
	return ret;
}

#define inv(x) qpow(x, mod - 2)
LL fac[MAXN + 10];

void init() {
	fac[0] = 1;
	for(LL i = 1; i <= MAXN; i++) fac[i] = fac[i - 1] * i % mod;
}

LL C(LL a, LL b) {
    return (fac[a] * inv(fac[b]) % mod * inv(fac[a - b]) % mod);
}

void solve(LL x) {
	for(LL i = 2; i * i <= x; i++) {
		if(x % i == 0) {
			LL cur = 0;
			while(x % i == 0) {
				x /= i;
				cur++;
			}
			P[++cnt] = cur;
		}
	}
	if(x > 1) P[++cnt] = 1;
}
 
signed main() {
	read(n), read(m);
	solve(m);
	LL ans = 1;
	init();
	for(LL i = 1; i <= cnt; i++) {
		ans *= (LL) C(P[i] + n - 1, n - 1) % mod;
	}
	printf("%lld\n", (ans + mod) % mod);
	return 0;
}