// CPP program to print prime factors and their 
// powers. 
#include <bits/stdc++.h> 
using namespace std; 

typedef long long       ll;
typedef pair<int,int>   ii;
typedef vector<ii>      vii;
typedef vector<int>     vi; 

// function to calculate all the prime factors and  
// count of every prime factor 
vector<int> factorize(long long n) 
{ 
    int count = 0; 
    vector<int> powers;
    // count the number of times 2 divides  
    while (!(n % 2)) { 
        n >>= 1; // equivalent to n=n/2; 
        count++; 
    } 
  
    // if 2 divides it 
    if (count) {//cout << 2 << "  " << count << endl;
        powers.push_back(count);
    }
  
    // check for all the possible numbers that can  
    // divide it 
    for (long long i = 3; i <= sqrt(n); i += 2) { 
        count = 0; 
        while (n % i == 0) { 
            count++; 
            n = n / i; 
        } 
        if (count) {//cout << i << "  " << count << endl; 
            powers.push_back(count);
        }
    } 
  
    // if n at the end is a prime number. 
    if (n > 2) {
        //cout << n << "  " << 1 << endl; 
        powers.push_back(1);    
    }
    return powers;
} 

long long int ncr(int n, int r) 
{ 
  
    // Initialize the answer 
    long long int ans = 1; 
  
    for (int i = 1; i <= r; i += 1) { 
  
        // Divide simultaneously by 
        // i to avoid overflow 
        ans *= (long long int)(n - r + i)%1000000007; 
        ans /= (long long int)i%1000000007; 
    } 
    return ans; 
} 

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};
 
mint mpow(int x, int n){
  if(n==0)return 1;
 
  mint y = mpow(x, n/2);
  y *= y;
}

struct combination {
	vector<mint> fact, ifact;
	combination(int n) :fact(n + 1), ifact(n + 1) {
		//assert(n < mod);
		fact[0] = 1;
		for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
		ifact[n] = fact[n].inv();
		for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
	}
	mint operator()(int n, int k) {
		if (k < 0 || k > n) return 0;
		return fact[n] * ifact[k] * ifact[n - k];
	}
};

// driver program to test the above function 
int main() 
{ 
    //long long n = 18967976895798;
    int N; cin >> N;
    int M; cin >> M;
    vector<int> powers = factorize(M);
    //for(auto &x: powers) {cout << x << endl;}
    mint prod = 1;
    combination com(2000010);
    for(int i = 0; i < powers.size(); ++i) {
        //prod *= DP(powers[i],N);
        prod *= com(powers[i]+N-1, powers[i]);
    }
    cout << prod.x << endl;
    /*
    int st, m; cin >> st >> m;
    cout << DP(st,m) << endl;*/
    return 0; 
} 


Measured memory_bytes: 31488