#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <bitset>
#include <utility>
#include <ctime>
#include <cassert>
#include <climits>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<long long> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef pair<long long,long long> pii;
typedef vector<pii > vii;
typedef vector<pair<long long, pair<long long, long long> > > viii;
typedef pair<ll,ll> pll;
typedef vector<string> vs;
typedef vector<vii> vvii;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define MEM(a,b) memset(a,(b),sizeof(a))
#define tr(c,it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
#define all(a) a.begin(),a.end()
#define loop(x,a,b) for(long long (x) = (a);(x)<(b);(x)++)
#define rep(x,n)   for(long long (x)=0;(x)<(n);(x)++)
#define present(c,x) ((c).find(x) != (c).end()) 
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ain(a,n) long long ((a)[(n)]); for(long long i=0; i<(n); i++) cin>>((a)[i])  
#define md 1000000007 
#define MOD 1000000007
#define MAXN 200005

#define pr16

#ifdef pr16
  #define pr(x)                 cerr << #x << ": " << x << endl;
  #define pr2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
  #define pr3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
  #define pr4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
  #define pr5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
  #define pr6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prc(a) tr(a, it) cerr<<*(it)<<" "; cerr<<endl
  #define pra(a,n) for(int i=0; i<(n); i++) cerr<<((a)[i])<<" "; cerr<<"\n"
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl; 
  #define prddd(a,x,y,z) for(int i=0;i<x;i++) {cerr<<"layer "<<i<<":\n";prdd(a[i],y,z)}

#else
  #define pr(x)
  #define pr2(x, y)
  #define pr3(x, y, z)
  #define pr4(a, b, c, d)
  #define pr5(a, b, c, d, e)
  #define pr6(a, b, c, d, e, f)
  #define tr(c,it)
  #define prc(a)
  #define pra(a,n)
  #define prdd(a, r, c)
  #define prddd(a,x,y,z)
#endif

const long long FNCRLIMIT = MAXN;
long long fac[FNCRLIMIT], inf[FNCRLIMIT];
long long fncrmod = md;

long long expMod(long long base, long long ex, long long mod = md)
{
  if(ex == 0) return 1;
  long long temp = expMod(base,ex/2,mod);
  temp = (temp*temp)%mod;
  if(ex%2) temp = (temp*base)%mod;
  return temp;
}


void fillncr()
{
  #ifdef MOD
  fncrmod = MOD;
  #endif

  fac[0] = 1; inf[0] = 1;
  
  for(long long i=1; i<FNCRLIMIT; i++)  {
    fac[i] = (fac[i-1]*(i))%fncrmod;
    inf[i] = expMod(fac[i], fncrmod-2, fncrmod);
  }
}

long long ncr(long long n, long long r)
{
  if(n<r) return 0;
  return (((fac[n] * inf[r]) % fncrmod) * inf[n-r]) % fncrmod;
}


int main()
{   
    ios::sync_with_stdio(false);
    cin.tie(0);
    long long n,m;
    fillncr();
    cin>>n>>m;
    vi cnt;
    loop(i,2,1e5) {
    	if(m % i != 0)
    		continue;
    	long long tmp = 0;
    	while(m%i == 0)
    	{
    		m /= i;
    		tmp += 1;
    	}
    	cnt.pb(tmp);
    }
    if(m > 1)
    	cnt.pb(1);
    ll ans = 1;
    rep(i, cnt.size())
    {
    	ans *= ncr(n+cnt[i]-1, n-1);
    	ans %= md;
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 3328