#include <iostream>
#include<bits/stdc++.h>
using namespace std;
unsigned int MOD = 1e9+7;

int pow2(long long x, int n) {
	long long ans = 1;
	while (n > 0) {
		if ((n & 1) == 1)ans = ans * x % MOD;
		x = x * x % MOD;
		n >>= 1;
	}
	return ans;
}

int comb(int a, int b){
	if (a - b < b) return comb(a, a - b);
	long long mul = 1;
	long long div = 1;
	for (int i = 0; i < b; i++){
		mul *= (a - i);
		div *= (i + 1);
		mul %= MOD;
		div %= MOD;
	}
	int ans = mul * pow2(div, MOD - 2) %MOD;
	return ans; 
}

int main(void){
    long long n,m,ans;
    ans = 1;
    cin >> n >> m;
    long long m2 = m;
    for(int i = 2;i*i<=m2;i++){
        int memo = 0;
        while(m%i == 0){
            m /= i;
            memo++;
        }
        ans *= comb(memo+n-1,memo);
        ans %= MOD;
        if(i>=3)i++;
    }
    if(m!=1)ans = n*ans%MOD;
    cout << ans << endl;
    return 0;
}